2709 search results for Doctrine

// ... lines 1 - 2
namespace AppBundle\Pagination;
use Doctrine\ORM\QueryBuilder;
// ... lines 6 - 7
use Symfony\Component\HttpFoundation\Request;
// ... lines 9 - 10
class PaginationFactory
{
// ... lines 13 - 19
public function createCollection(QueryBuilder $qb, Request $request, $route, array $routeParams = array())
{
// ... lines 22 - 53
}
}
See Code Block in Script
// ... lines 1 - 5
use Doctrine\Common\Annotations\Reader;
// ... lines 7 - 12
class LinkSerializationSubscriber implements EventSubscriberInterface
{
private $router;
private $annotationReader;
// ... lines 18 - 20
public function __construct(RouterInterface $router, Reader $annotationReader)
{
$this->router = $router;
$this->annotationReader = $annotationReader;
// ... line 25
}
// ... lines 27 - 72
}
See Code Block in Script
57 lines | app/AppKernel.php
// ... lines 1 - 5
class AppKernel extends Kernel
{
public function registerBundles()
{
// ... lines 10 - 25
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
// ... lines 27 - 30
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
}
// ... lines 33 - 34
}
// ... lines 36 - 55
}
See Code Block in Script
39 lines | src/Controller/MainController.php
// ... lines 1 - 6
use Pagerfanta\Doctrine\ORM\QueryAdapter;
// ... lines 8 - 14
class MainController extends AbstractController
{
// ... line 17
public function homepage(
// ... lines 19 - 23
): Response
{
$pager = Pagerfanta::createForCurrentPageWithMaxPerPage(
new QueryAdapter($voyageRepository->findBySearchQueryBuilder($query, $searchPlanets)),
$page,
10
);
// ... lines 31 - 36
}
}
See Code Block in Script
102 lines | src/Repository/FortuneCookieRepository.php
// ... lines 1 - 8
use Doctrine\Common\Collections\Criteria;
// ... lines 10 - 19
class FortuneCookieRepository extends ServiceEntityRepository
{
// ... lines 22 - 26
public static function createFortuneCookiesStillInProductionCriteria(): Criteria
{
return Criteria::create()
->andWhere(Criteria::expr()->eq('discontinued', false));
}
// ... lines 32 - 100
}
See Code Block in Script
169 lines | src/Entity/DragonTreasure.php
// ... lines 1 - 5
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
// ... lines 7 - 39
class DragonTreasure
{
// ... lines 42 - 48
#[ApiFilter(SearchFilter::class, strategy: 'partial')]
private ?string $name = null;
// ... lines 51 - 53
#[ApiFilter(SearchFilter::class, strategy: 'partial')]
private ?string $description = null;
// ... lines 56 - 167
}
See Code Block in Script
50 lines | src/Controller/SecurityController.php
// ... lines 1 - 4
use Doctrine\ORM\EntityManagerInterface;
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Totp\TotpAuthenticatorInterface;
// ... lines 7 - 12
class SecurityController extends BaseController
{
// ... lines 15 - 37
public function enable2fa(TotpAuthenticatorInterface $totpAuthenticator, EntityManagerInterface $entityManager)
{
// ... lines 40 - 47
}
}
See Code Block in Script
// ... lines 1 - 5
use Doctrine\ORM\QueryBuilder;
// ... lines 7 - 22
class UserCrudController extends AbstractCrudController
{
// ... lines 25 - 35
public function createIndexQueryBuilder(SearchDto $searchDto, EntityDto $entityDto, FieldCollection $fields, FilterCollection $filters): QueryBuilder
{
return parent::createIndexQueryBuilder($searchDto, $entityDto, $fields, $filters);
}
// ... lines 40 - 73
}
See Code Block in Script
// ... lines 1 - 5
use Doctrine\ORM\QueryBuilder;
// ... lines 7 - 12
class QuestionCrudController extends AbstractCrudController
{
// ... lines 15 - 19
public function configureFields(string $pageName): iterable
{
// ... lines 22 - 29
yield AssociationField::new('askedBy')
// ... lines 31 - 38
->setQueryBuilder(function (QueryBuilder $qb) {
// ... lines 40 - 41
});
// ... lines 43 - 44
}
}
See Code Block in Script
// ... lines 1 - 5
use App\Photo\PhotoFileManager;
use App\Photo\PhotoPonkaficator;
use Doctrine\ORM\EntityManagerInterface;
// ... lines 9 - 10
class AddPonkaToImageHandler implements MessageHandlerInterface
{
// ... lines 13 - 16
public function __construct(PhotoPonkaficator $ponkaficator, PhotoFileManager $photoManager, EntityManagerInterface $entityManager)
{
// ... lines 19 - 21
}
// ... lines 23 - 32
}
See Code Block in Script
... repository class. Triple-check that these are identical. 2) (this is the more likely cause) Doctrine is (for some reason) not seeing your `@ORM\Entity(repositoryClass="AppBundle\Repository\GenusNoteRepository")` annotation ...
weaverryan
weaverryan
Read Full Comment
... ", "composer/package-versions-deprecated": "^1.11", "doctrine/annotations": "^1.0", "doctrine/doctrine-bundle": "^1.6", "doctrine/orm": "^2.4.5", "nelmio/cors-bundle": "^1.5 ...
Hey Tomas, Good qustion! Well, ManagerRegistry is something more global in Doctrine, it will allow you to get instance to the entity manager iteself, to other Doctrine features. You can look at that service to see what ...
... - same idea, but I like this a little better) - http://doctrine-orm.readthedocs.org/projects/doctrine-dbal/en/latest/reference/types.html#json-array. In this case, your roles property is an array, but in MySQL, Doctrine ...
weaverryan
weaverryan
Read Full Comment
Entity DTO Item State Provider

... querying work manually. Instead, we'll... "delegate" it the core Doctrine item provider. Add a second argument... we can just copy the first... type-hinted with ItemProvider (the one from Doctrine ORM), and called ...

4:11
Auto Setting the owner

... processor that comes from Doctrine: it's responsible for saving the object to the database. Our goal will feel familiar at this point: to decorate that state process so we can run extra code before saving. Like before, start ...

4:19
Adding Items to a Collection Property

... important because of how Doctrine handles relationships: setting the owner sets what's called the "owning" side of the relationship. Basically, without this, Doctrine wouldn't save this change to the database. The takeaway is ...

4:04
The 4 2 Possible Relation Types

Officially, there are four types of relations in Doctrine: ManyToOne, OneToMany, OneToOne and ManyToMany. But... that's kind of a lie! In reality, there are only two types. Let me explain. We already know that a ...

4:02
Saving Relations

... property, we're setting the entire Question object onto the property. Doctrine will be smart enough to save these in the correct order: it'll save the question first, grab its new id, and use that to save the Answer. To ...

3:58
Input Data Transformer

... object. Second, we transform that CheeseListingInput into a CheeseListing in the data transformer. And third, the normal Doctrine data persister saves things. That's a really clean process! Go back to the docs and look at the ...

4:24