1000 search results

15 lines | src/AppBundle/Entity/Movie.php
// ... lines 1 - 4
use Doctrine\ORM\Mapping as ORM;
// ... lines 6 - 15
See Code Block in Script
15 lines | src/AppBundle/Entity/Movie.php
// ... lines 1 - 4
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="movie")
*/
class Movie
{
}
See Code Block in Script
56 lines | src/AppBundle/Test/ApiTestCase.php
// ... lines 1 - 4
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
// ... lines 6 - 8
class ApiTestCase extends KernelTestCase
{
// ... lines 11 - 44
private function purgeDatabase()
{
$purger = new ORMPurger($this->getService('doctrine')->getManager());
$purger->purge();
}
// ... lines 50 - 55
}
See Code Block in Script
// ... lines 1 - 5
use Doctrine\ORM\EntityManager;
// ... lines 7 - 17
class WeirdFormAuthenticator extends AbstractGuardAuthenticator
{
private $em;
// ... lines 21 - 22
public function __construct(EntityManager $em, RouterInterface $router)
{
$this->em = $em;
// ... line 26
}
// ... lines 28 - 99
}
See Code Block in Script
16 lines | app/autoload.php
// ... lines 1 - 2
use Doctrine\Common\Annotations\AnnotationRegistry;
// ... lines 4 - 12
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
// ... lines 14 - 16
See Code Block in Script
129 lines | features/bootstrap/FeatureContext.php
// ... lines 1 - 120
/**
* @return \Doctrine\ORM\EntityManager
*/
private function getEntityManager()
{
return $this->getContainer()->get('doctrine.orm.entity_manager');
}
// ... lines 128 - 129
See Code Block in Script
22 lines | .env.dist
// ... lines 1 - 15
###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
###< doctrine/doctrine-bundle ###
See Code Block in Script
22 lines | .env.dist
// ... lines 1 - 15
###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://root:@127.0.0.1:3306/symfony4_space_bar
###< doctrine/doctrine-bundle ###
See Code Block in Script
101 lines | src/Controller/ArticleController.php
// ... lines 1 - 7
use Doctrine\ORM\EntityManagerInterface;
// ... lines 9 - 15
class ArticleController extends AbstractController
{
// ... lines 18 - 35
/**
* @Route("/news/{slug}", name="article_show")
*/
public function show($slug, MarkdownHelper $markdownHelper, SlackClient $slack, EntityManagerInterface $em)
{
// ... lines 41 - 86
}
// ... lines 88 - 99
}
See Code Block in Script
56 lines | src/Controller/ArticleAdminController.php
// ... lines 1 - 5
use Doctrine\ORM\EntityManagerInterface;
// ... lines 7 - 10
class ArticleAdminController extends AbstractController
{
// ... lines 13 - 15
public function new(EntityManagerInterface $em)
{
// ... lines 18 - 53
}
}
See Code Block in Script
56 lines | src/Controller/ArticleAdminController.php
// ... lines 1 - 5
use Doctrine\ORM\EntityManagerInterface;
// ... lines 7 - 10
class ArticleAdminController extends AbstractController
{
// ... lines 13 - 15
public function new(EntityManagerInterface $em)
{
// ... lines 18 - 40
// publish most articles
if (rand(1, 10) > 2) {
$article->setPublishedAt(new \DateTime(sprintf('-%d days', rand(1, 100))));
}
$em->persist($article);
$em->flush();
// ... lines 48 - 53
}
}
See Code Block in Script
56 lines | src/Controller/ArticleAdminController.php
// ... lines 1 - 5
use Doctrine\ORM\EntityManagerInterface;
// ... lines 7 - 10
class ArticleAdminController extends AbstractController
{
// ... lines 13 - 15
public function new(EntityManagerInterface $em)
{
// ... lines 18 - 45
$em->persist($article);
$em->flush();
return new Response(sprintf(
'Hiya! New Article id: #%d slug: %s',
$article->getId(),
$article->getSlug()
));
}
}
See Code Block in Script
81 lines | src/Controller/ArticleController.php
// ... lines 1 - 7
use Doctrine\ORM\EntityManagerInterface;
// ... lines 9 - 15
class ArticleController extends AbstractController
{
// ... lines 18 - 30
public function homepage(EntityManagerInterface $em)
{
// ... lines 33 - 38
}
// ... lines 40 - 79
}
See Code Block in Script
51 lines | src/Repository/ArticleRepository.php
// ... lines 1 - 5
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
// ... lines 7 - 14
class ArticleRepository extends ServiceEntityRepository
{
// ... lines 17 - 49
}
See Code Block in Script
93 lines | src/Entity/Article.php
// ... lines 1 - 4
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\ArticleRepository")
*/
class Article
{
// ... lines 12 - 91
}
See Code Block in Script
34 lines | src/DataFixtures/BaseFixture.php
// ... lines 1 - 5
use Doctrine\Common\Persistence\ObjectManager;
abstract class BaseFixture extends Fixture
{
/** @var ObjectManager */
private $manager;
// ... lines 12 - 32
}
See Code Block in Script
93 lines | src/Entity/Article.php
// ... lines 1 - 4
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\ArticleRepository")
*/
class Article
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="string", length=100)
*/
private $slug;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $content;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $publishedAt;
// ... lines 38 - 91
}
See Code Block in Script
54 lines | src/Repository/ArticleRepository.php
// ... lines 1 - 6
use Doctrine\ORM\QueryBuilder;
// ... lines 8 - 15
class ArticleRepository extends ServiceEntityRepository
{
// ... lines 18 - 48
private function addIsPublishedQueryBuilder(QueryBuilder $qb)
{
// ... line 51
}
}
See Code Block in Script
58 lines | src/Repository/ArticleRepository.php
// ... lines 1 - 6
use Doctrine\ORM\QueryBuilder;
// ... lines 8 - 15
class ArticleRepository extends ServiceEntityRepository
{
// ... lines 18 - 52
private function getOrCreateQueryBuilder(QueryBuilder $qb = null)
{
// ... line 55
}
}
See Code Block in Script
75 lines | src/Controller/ArticleController.php
// ... lines 1 - 8
use Doctrine\ORM\EntityManagerInterface;
// ... lines 10 - 16
class ArticleController extends AbstractController
{
// ... lines 19 - 61
/**
* @Route("/news/{slug}/heart", name="article_toggle_heart", methods={"POST"})
*/
public function toggleArticleHeart(Article $article, LoggerInterface $logger, EntityManagerInterface $em)
{
// ... lines 67 - 72
}
}
See Code Block in Script