Search Results

Search found 44 results on 2 pages for 'doctrine2'.

Page 1/2 | 1 2  | Next Page >

  • Testing a Doctrine2 Entity with assertEquals results in fatal out-of-memory error

    - by Matt
    I have a PHPUnit test that's using a Doctrine2 custom repository and Doctrine Fixtures. I wanted to test that a query gave me back an expected entity from my fixture. But when I try $this->assertEquals($expectedEntity, $result);, I get Fatal error: out of memory. I'm guessing it is recursing into all the relations and the entity manager and whatnot. Is there a good way to test this equality? Should I just assertEquals on the IDs of the entities?

    Read the article

  • Doctrine2 - relationship

    - by Filip Golonka
    I'm developing an application, which is looking for optimal route and timetable in public transport. I have some experience about Doctrine1, but it's my first time with Doctrine2. There is soem new fields to describe relations (mappedBy and inversedBy) and also some new ways of mapping. I have following code: $query = $this->em->createQuery("SELECT partial cls.{stop}, partial t.{arriveTime, departureTime} FROM \Entities\Timetable t JOIN t.ride r JOIN t.carrierLineStop cls WHERE t.departureTime>=:time AND r.idCarrierLine=:carrierLine AND (cls.idStop=:firstStop OR cls.idStop=:lastStop)"); $query->setParameters(array( 'time' => $time, 'carrierLine' => $path->getLine(), 'firstStop' => $path->getFirstStop(), 'lastStop' => $path->getLastStop() )); When I try to execute that script I've got an error: [Semantical Error] line 0, col 24 near '}, partial t.{arriveTime,': Error: There is no mapped field named 'stop' on class Entities\CarrierLineStop. Mapping files: Entities\CarrierLineStop: type: entity table: carrier_line_stop fields: idCarrierLineStop: id: true type: integer unsigned: false nullable: false column: id_carrier_line_stop generator: strategy: IDENTITY nextStop: type: integer unsigned: false nullable: true column: next_stop manyToOne: idCarrierLine: targetEntity: Entities\CarrierLine cascade: { } mappedBy: null inversedBy: null joinColumns: id_carrier_line: referencedColumnName: id_carrier_line orphanRemoval: false stop: column: id_stop targetEntity: Entities\Stop cascade: { } mappedBy: null inversedBy: carrierLineStop joinColumns: id_stop: referencedColumnName: id_stop orphanRemoval: false lifecycleCallbacks: { } - Entities\Stop: type: entity table: stop fields: idStop: id: true type: integer unsigned: false nullable: false column: id_stop generator: strategy: IDENTITY name: type: string length: 45 fixed: false nullable: true miejscowosc: type: string length: 45 fixed: false nullable: true latitude: type: decimal nullable: true longitude: type: decimal nullable: true oneToMany: carrierLineStop: targetEntity: Entities\CarrierLineStop cascade: { } mappedBy: stop inversedBy: null joinColumns: id_stop: referencedColumnName: id_stop orphanRemoval: false lifecycleCallbacks: { } I have no idea about where the problem is...

    Read the article

  • Not finding field in polymorphic association with Doctrine2

    - by dimirc
    I have a polymorphic association (Class Table Inheritance) and I need use DQL to query entities of a specific child class wich can be done using "x INSTANCE OF Entity" in WHERE clause. Now I need to put conditions specific for that child class but I get this error: "Class Person has no association named student_field_1" Person = Parent Class Employee = Child class Student = Child class is there any way yo cast of somehow tell Doctrine that the Person is actually a Student and to allow me to put Student fields in the WHERE?

    Read the article

  • How to debug MySQL/Doctrine2 Queries?

    - by jiewmeng
    I am using MySQL with Zend Framework & Doctrine 2. I think even if you don't use Doctrine 2, you will be familiar with errors like SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC' at line 1 The problem is that I don't see the full query. Without an ORM framework, I could probably echo the sql easily, but with a framework, how can I find out what SQL its trying to execute? I narrowed the error down to $progress = $task->getProgress(); $progress is declared // Application\Models\Task /** * @OneToMany(targetEntity="TaskProgress", mappedBy="task") * @OrderBy({"seq" = "ASC"}) */ protected $progress; In MySQL, the task class looks like CREATE TABLE `tasks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `owner_id` int(11) DEFAULT NULL, `assigned_id` int(11) DEFAULT NULL, `list_id` int(11) DEFAULT NULL, `name` varchar(60) NOT NULL, `seq` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `tasks_owner_id_idx` (`owner_id`), KEY `tasks_assigned_id_idx` (`assigned_id`), KEY `tasks_list_id_idx` (`list_id`), CONSTRAINT `tasks_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`), CONSTRAINT `tasks_ibfk_2` FOREIGN KEY (`assigned_id`) REFERENCES `users` (`id`), CONSTRAINT `tasks_ibfk_3` FOREIGN KEY (`list_id`) REFERENCES `lists` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1$$

    Read the article

  • Doctrine2 ArrayCollection

    - by boosis
    Ok, I have a User entity as follows <?php class User { /** * @var integer * @Id * @Column(type="integer") * @GeneratedValue */ protected $id; /** * @var \Application\Entity\Url[] * @OneToMany(targetEntity="Url", mappedBy="user", cascade={"persist", "remove"}) */ protected $urls; public function __construct() { $this->urls = new \Doctrine\Common\Collections\ArrayCollection(); } public function addUrl($url) { // This is where I have a problem } } Now, what I want to do is check if the User has already the $url in the $urls ArrayCollection before persisting the $url. Now some of the examples I found says we should do something like if (!$this->getUrls()->contains($url)) { // add url } but this doesn't work as this compares the element values. As the $url doesn't have id value yet, this will always fail and $url will be dublicated. So I'd really appreciate if someone could explain how I can add an element to the ArrayCollection without persisting it and avoiding the duplication? Edit I have managed to achive this via $p = function ($key, $element) use ($url) { if ($element->getUrlHash() == $url->getUrlHash()) { return true; } else { return false; } }; But doesn't this still load all urls and then performs the check? I don't think this is efficient as there might be thousands of urls per user.

    Read the article

  • Doctrine2 update both sides of association

    - by orourkedd
    I'm using this to update both sides of an association but want to know if there is a more efficient way to do this. In this case, it is a self-referencing OneToMany parent/child association: public function setParent(Node $parent, $inverse = true) { $this->parent = $parent; if($inverse) $parent->addChild($this, false); } public function addChild(Node $child, $inverse = true) { if(!$this->children->contains($child)) { $this->children[] = $child; if($inverse) $child->setParent($this, false); } }

    Read the article

  • Doctrine2 Mutliple DBs without Symfony2?

    - by ehime
    Hey guys I know that using the Doctrinebundle in Symfony2 it is possible to instantiate multiple DB connections under Doctrine... $connectionFactory = $this->container->get('doctrine.dbal.connection_factory'); $connection = $connectionFactory->createConnection(array( 'driver' => 'pdo_mysql', 'user' => 'foo_user', 'password' => 'foo_pass', 'host' => 'foo_host', 'dbname' => 'foo_db', )); I'm curious if this is the case if you are using PURELY Doctrine though?, I've set up Doctrine via Composer like so... { "config": { "vendor-dir": "lib/" }, "require": { "doctrine/orm": "2.3.4", "doctrine/dbal": "2.3.4" } } And have been looking for my ConnectionFactory class but am not seeing it anywhere? Am I required to use Symfony2 to do this? Thanks!

    Read the article

  • doctrine2: many-to-one with non default referencedColumnName does not persist entity

    - by timaschew
    I'm using symfony 2.1.2 with FOSUserBundle. I extend the User from FOS and define a many-to-one (bidirectional) association to a Customer entity. I don't want to use primary key for the association (referencedColumnName). I will use another integer uniqe column: customer_no use FOS\UserBundle\Entity\User as BaseUser; /** * @ORM\Entity * @ORM\Table(name="t_myuser") */ class MyUser extends BaseUser { /** * @ORM\ManyToOne(targetEntity="Customer", inversedBy="user") * @ORM\JoinColumn(name="customer_no", referencedColumnName="customer_no", nullable=false) */ $public $customer; } /** * @ORM\Entity * @ORM\Table(name="t_customer") */ class Customer extends BaseEntity // provides an id (pk) { /** * @ORM\Column(type="integer", unique=true, nullable=false) */ public $customer_no; /** * @ORM\OneToMany(targetEntity="MyUser", mappedBy="customer") */ public $user; } When I try to persist (via a form) a new MyUser entity with an (already in db existing and) loaded Customer entity from db, I get this error: Notice: Undefined index: customer_no in ...\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\BasicEntityPersister.php line 608 The schema on the db is all right. //update: I fix the inversedBy and mappedBy stuff, but this is not the problem.

    Read the article

  • Doctrine2 use of criteria inside the entity class

    - by Piotr Kowalczuk
    They try to write a method whose task would be to return only selected elements of the collection of items associated with a particular entity. /** * @ORM\OneToMany(targetEntity="PlayerStats", mappedBy="summoner") * @ORM\OrderBy({"player_stat_summary_type" = "ASC"}) */ protected $player_stats; public function getPlayerStatsBySummaryType($summary_type) { if ($this->player_stats->count() != 0) { $criteria = Criteria::create() ->where(Criteria::expr()->eq("player_stat_summary_type", $summary_type)); return $this->player_stats->matching($criteria)->first(); } return null; } but i get error: PHP Fatal error: Cannot access protected property Ranking\CoreBundle\Entity\PlayerStats::$player_stat_summary_type in /Users/piotrkowalczuk/Sites/lolranking/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php on line 53 any idea how to fix this?

    Read the article

  • Doctrine2: Filtering by ManToMany Association

    - by Shroder
    I want to retrieve a collection of objects based on what they are associated to. For example, by a category. This would be a Many to Many relationship. I've been able to achieve that with MEMBER OF, however I need to pass in an array of IDs, opposed to one at a time. I see there is an "IN ()", but it seems to require a subquery, which I would like to avoid. MEMBER OF example: SELECT o FROM Entity\Object1 o WHERE 'CATEGORY_CODE' MEMBER OF o.categories (Edit) This is what I would like to do, but perhaps I'm misunderstanding how entities work in DQL: SELECT o FROM Entity\Object1 o WHERE o.categories.Id IN (id, id, id)

    Read the article

  • Does retrieving an object from Doctrine2 cause __construct() of the model class to run?

    - by jiewmeng
    When I retrieve an object say by $em->find('Application\Models\User', 1); or other methods like DQL, findBy*() cause the __construct() of the model class to run? I am having a problem where I set variables there like reference to EntityManager and I find that its not set. I tried putting a die() in __construct() and it doesn't halt the application. Can I say that if I want to set other properties/fields like EntityManager $em I have to do it some other way? Perhaps something like protected function getEm() { if (!isset($this->em)) { $this->em = \Zend_Registry::get('em'); } return $this->em; }

    Read the article

  • Is there a way to query if array field contains a certain value in Doctrine2?

    - by dpimka
    Starting out with Symfony2 + Doctrine. I have a table with User objects (fos_user), for which my schema contains a roles column of an 'array' type. Doctrine saves fields of this type by serializing them from php 'array' to 'longtext' (in mysql's case). So let's say I have the following users saved into DB: **User1**: array(ROLE_ADMIN, ROLE_CUSTOM1) **User2**: array(ROLE_ADMIN, ROLE_CUSTOM2) **User3**: array(ROLE_CUSTOM2) Now in my controller I want to select all users with ROLE_ADMIN set. Is there a way to write a DQL query which would directly return me User1 and User2? Or do I need to fetch all users to have Doctrine to unserialize roles column and then for each of them do in_array('ROLE_ADMIN', $user-getRoles())? I have searched the DQL part of the manual, but so far did not find anything similar to my needs...

    Read the article

  • DoctrineExtensions SoftDeleteable

    - by Cochuyt Joeri
    I'm setting up symfony2 with doctrine2 and I want to use the DoctrineExtensions (Gedmo) I followed every step, and most is working, but I fail to locate the config file where I need to make changes for the SoftDeleteable to work. https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/softdeleteable.md $config = new Doctrine\ORM\Configuration; // Your configs.. $config-addFilter('soft-deleteable', 'Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter');

    Read the article

  • using onDelete with Doctrine 2

    - by tamir
    I can't get the onDelete to work in Doctrine2 (with YAML Mapping). I tried this relation in my Product class: oneToOne: category: targetEntity: Category onDelete: CASCADE But that doesn't work.. EDIT: I've set the ON DELETE: CASCADE manually in the database imported the YAML mapping with doctrine:mapping:import, emptied the database updated it from the schema with doctrine:schema:update and got no ON DELETE in the foreign key.. so looks like even Doctrine doesn't know how to do it lol..

    Read the article

  • How to make a nested query with an Entity that doesn't really exist (many-to-many)

    - by Calou
    Hi everyone, I'm new with Doctrine2 so my question can be easy to answer (I hope so). First of all, here the SQL query that I'd want : SELECT * FROM Document WHERE id NOT IN (SELECT document_id FROM Documents_Folders) Pretty simple isn't it ? The porblem is that my table 'Documents_Folders' is not an entity. In fact, it was create because I have a many-to-many relation between my entities 'Document' and 'Folder'. I tried several queries, but none worked. Thanks.

    Read the article

  • Oddities when mixing Zend Framework 1.11 & Doctrine 2 Autoloaders

    - by jiewmeng
    I have setup autoloading in my ZF/Doctrine2 app as follows $zendAutoloader = Zend_Loader_Autoloader::getInstance(); $autoloader = array(new ClassLoader('Symfony'), 'loadClass'); $zendAutoloader->pushAutoloader($autoloader, 'Symfony'); $autoloader = array(new ClassLoader('Doctrine'), 'loadClass'); $zendAutoloader->pushAutoloader($autoloader, 'Doctrine'); $autoloader = array(new ClassLoader('Application', realpath(__DIR__ . '/..')), 'loadClass'); $zendAutoloader->pushAutoloader($autoloader, 'Application'); $autoloader = array(new ClassLoader('DoctrineExtensions'), 'loadClass'); $zendAutoloader->pushAutoloader($autoloader, 'DoctrineExtensions'); I find that the DoctrineExtensions autoloading is not working while other classes are ... to verify that the path etc are right, I tried $autoloader = new ClassLoader('DoctrineExtensions'); $autoloader->register(); And it works. So it seems it has something to do with Zend Framework?

    Read the article

  • Injecting dependency into entity repository

    - by Hubert Perron
    Is there a simple way to inject a dependency into every repository instance in Doctrine2 ? I have tried listening to the loadClassMetadata event and using setter injection on the repository but this naturally resulted in a infinite loop as calling getRepository in the event triggered the same event. After taking a look at the Doctrine\ORM\EntityManager::getRepository method it seems like repositories are not using dependency injection at all, instead they are instantiated at the function level: public function getRepository($entityName) { $entityName = ltrim($entityName, '\\'); if (isset($this->repositories[$entityName])) { return $this->repositories[$entityName]; } $metadata = $this->getClassMetadata($entityName); $customRepositoryClassName = $metadata->customRepositoryClassName; if ($customRepositoryClassName !== null) { $repository = new $customRepositoryClassName($this, $metadata); } else { $repository = new EntityRepository($this, $metadata); } $this->repositories[$entityName] = $repository; return $repository; } Any ideas ?

    Read the article

  • How to merge two php Doctrine 2 ArrayCollection()

    - by Throoze
    Is there any convenience method that allows me to concatenate two Doctrine ArrayCollection()? something like: $collection1 = new ArrayCollection(); $collection2 = new ArrayCollection(); $collection1->add($obj1); $collection1->add($obj2); $collection1->add($obj3); $collection2->add($obj4); $collection2->add($obj5); $collection2->add($obj6); $collection1->concat($collection2); // $collection1 now contains {$obj1, $obj2, $obj3, $obj4, $obj5, $obj6 } I just want to know if I can save me iterating over the 2nd collection and adding each element one by one to the 1st collection. Thanks!

    Read the article

  • Unknown Entity namespace alias in symfony2

    - by Zoha Ali Khan
    Hey I have two bundles in my symfony2 project. one is Bundle and the other one is PatentBundle. My app/config/route.yml file is MunichInnovationGroupPatentBundle: resource: "@MunichInnovationGroupPatentBundle/Controller/" type: annotation prefix: / defaults: { _controller: "MunichInnovationGroupPatentBundle:Default:index" } MunichInnovationGroupBundle: resource: "@MunichInnovationGroupBundle/Controller/" type: annotation prefix: /v1 defaults: { _controller: "MunichInnovationGroupBundle:Patent:index" } login_check: pattern: /login_check logout: pattern: /logout inside my controller i have <?php namespace MunichInnovationGroup\PatentBundle\Controller; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; use JMS\SecurityExtraPatentBundle\Annotation\Secure; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Security\Core\SecurityContext; use MunichInnovationGroup\PatentBundle\Entity\Log; use MunichInnovationGroup\PatentBundle\Entity\UserPatent; use MunichInnovationGroup\PatentBundle\Entity\PmPortfolios; use MunichInnovationGroup\PatentBundle\Entity\UmUsers; use MunichInnovationGroup\PatentBundle\Entity\PmPatentgroups; use MunichInnovationGroup\PatentBundle\Form\PortfolioType; use MunichInnovationGroup\PatentBundle\Util\SecurityHelper; use Exception; /** * Portfolio controller. * @Route("/portfolio") */ class PortfolioController extends Controller { /** * Index action. * * @Route("/", name="v2_pm_portfolio") * @Template("MunichInnovationGroupPatentBundle:Portfolio:index.html.twig") */ public function indexAction(Request $request) { $portfolios = $this->getDoctrine() ->getRepository('MunichInnovationGroupPatentBundle:PmPortfolios') ->findBy(array('user' => '$user_id')); // rest of the method } when i try to load localhost/web/app_dev.php/portfolio It says Unknown Entity namespace alias 'MunichInnovationGroupPatentBundle'. I am unable to figure out this error please help me if anyone has any idea I googled it a lot :( Thanks in advance 500 Internal Server Error - ORMException

    Read the article

  • Doctrine 2 Cannot find entites

    - by Flyn San
    I'm using Kohana 3 and have a /doctrine/Entites folder with my entities inside. When executing the code $product = Doctrine::em()->find('Entities\Product', 1); in my controller, I get the error class_parents(): Class Entities\Product does not exist and could not be loaded Below is the Controller (classes/controller/welcome.php): <?php class Controller_Welcome extends Controller { public function action_index() { $prod = Doctrine::em()->find('Entities\Product', 1); } } Below is the Entity (/doctrine/Entities/Product.php): <?php /** * @Entity * @Table{name="products"} */ class Product { /** @Id @Column{type="integer"} */ private $id; /** @Column(type="string", length="255") */ private $name; public function getId() { return $this->id; } public function setId($id) { $this->id = intval($id); } public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } } Below is the Doctrine module bootstrap file (/modules/doctrine/init.php): class Doctrine { private static $_instance = null; private $_application_mode = 'development'; private $_em = null; public static function em() { if ( self::$_instance === null ) self::$_instance = new Doctrine(); return self::$_instance->_em; } public function __construct() { require __DIR__.'/classes/doctrine/Doctrine/Common/ClassLoader.php'; $classLoader = new \Doctrine\Common\ClassLoader('Doctrine', __DIR__.'/classes/doctrine'); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__.'/classes/doctrine/Doctrine'); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader('Entities', APPPATH.'doctrine'); $classLoader->register(); //Set up caching method $cache = $this->_application_mode == 'development' ? new \Doctrine\Common\Cache\ArrayCache : new \Doctrine\Common\Cache\ApcCache; $config = new Configuration; $config->setMetadataCacheImpl( $cache ); $driver = $config->newDefaultAnnotationDriver( APPPATH.'doctrine/Entities' ); $config->setMetadataDriverImpl( $driver ); $config->setQueryCacheImpl( $cache ); $config->setProxyDir( APPPATH.'doctrine/Proxies' ); $config->setProxyNamespace('Proxies'); $config->setAutoGenerateProxyClasses( $this->_application_mode == 'development' ); $dbconf = Kohana::config('database'); $dbconf = reset($dbconf); //Use the first database specified in the config $this->_em = EntityManager::create(array( 'dbname' => $dbconf['connection']['database'], 'user' => $dbconf['connection']['username'], 'password' => $dbconf['connection']['password'], 'host' => $dbconf['connection']['hostname'], 'driver' => 'pdo_mysql', ), $config); } } Any ideas what I've done wrong?

    Read the article

  • Seems doctrine listener is not fired

    - by Roel Veldhuizen
    Got a service which should be executed the moment an object is persisted. Though, I think the code looks like it should work, it doesn't. I configured the service like the following yml. services: bla_orm.listener: class: Bla\OrmBundle\EventListener\UserManager arguments: [@security.encoder_factory] tags: - { name: doctrine.event_listener, event: prePersist } The class: namespace Bla\OrmBundle\EventListener; use Doctrine\ORM\Event\LifecycleEventArgs; use Bla\OrmBundle\Entity\User; class UserManager { protected $encoderFactory; public function __construct(\Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface $encoderFactory) { $this->encoderFactory = $encoderFactory; } public function prePersist(LifecycleEventArgs $args) { $entity = $args->getEntity(); if ($entity instanceof User) { $encoder = $this->encoderFactory ->getEncoder($entity); $entity->setSalt(rand(10000, 99999)); $password = $encoder->encodePassword($entity->getPassword(), $entity->getSalt()); $entity->setPassword($password); } } } Symfony version: Symfony version 2.3.3 - app/dev/debug Output of container:debug [container] Public services Service Id Scope Class Name annotation_reader container Doctrine\Common\Annotations\FileCacheReader assetic.asset_manager container Assetic\Factory\LazyAssetManager assetic.controller prototype Symfony\Bundle\AsseticBundle\Controller\AsseticController assetic.filter.cssrewrite container Assetic\Filter\CssRewriteFilter assetic.filter_manager container Symfony\Bundle\AsseticBundle\FilterManager assetic.request_listener container Symfony\Bundle\AsseticBundle\EventListener\RequestListener cache_clearer container Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer cache_warmer container Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate data_collector.request container Symfony\Component\HttpKernel\DataCollector\RequestDataCollector data_collector.router container Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector database_connection n/a alias for doctrine.dbal.default_connection debug.controller_resolver container Symfony\Component\HttpKernel\Controller\TraceableControllerResolver debug.deprecation_logger_listener container Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener debug.emergency_logger_listener container Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener debug.event_dispatcher container Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher debug.stopwatch container Symfony\Component\Stopwatch\Stopwatch debug.templating.engine.php container Symfony\Bundle\FrameworkBundle\Templating\TimedPhpEngine debug.templating.engine.twig n/a alias for templating doctrine container Doctrine\Bundle\DoctrineBundle\Registry doctrine.dbal.connection_factory container Doctrine\Bundle\DoctrineBundle\ConnectionFactory doctrine.dbal.default_connection container stdClass doctrine.orm.default_entity_manager container Doctrine\ORM\EntityManager doctrine.orm.default_manager_configurator container Doctrine\Bundle\DoctrineBundle\ManagerConfigurator doctrine.orm.entity_manager n/a alias for doctrine.orm.default_entity_manager doctrine.orm.validator.unique container Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator doctrine.orm.validator_initializer container Symfony\Bridge\Doctrine\Validator\DoctrineInitializer event_dispatcher container Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher file_locator container Symfony\Component\HttpKernel\Config\FileLocator filesystem container Symfony\Component\Filesystem\Filesystem form.csrf_provider container Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider form.factory container Symfony\Component\Form\FormFactory form.registry container Symfony\Component\Form\FormRegistry form.resolved_type_factory container Symfony\Component\Form\ResolvedFormTypeFactory form.type.birthday container Symfony\Component\Form\Extension\Core\Type\BirthdayType form.type.button container Symfony\Component\Form\Extension\Core\Type\ButtonType form.type.checkbox container Symfony\Component\Form\Extension\Core\Type\CheckboxType form.type.choice container Symfony\Component\Form\Extension\Core\Type\ChoiceType form.type.collection container Symfony\Component\Form\Extension\Core\Type\CollectionType form.type.country container Symfony\Component\Form\Extension\Core\Type\CountryType form.type.currency container Symfony\Component\Form\Extension\Core\Type\CurrencyType form.type.date container Symfony\Component\Form\Extension\Core\Type\DateType form.type.datetime container Symfony\Component\Form\Extension\Core\Type\DateTimeType form.type.email container Symfony\Component\Form\Extension\Core\Type\EmailType form.type.entity container Symfony\Bridge\Doctrine\Form\Type\EntityType form.type.file container Symfony\Component\Form\Extension\Core\Type\FileType form.type.form container Symfony\Component\Form\Extension\Core\Type\FormType form.type.hidden container Symfony\Component\Form\Extension\Core\Type\HiddenType form.type.integer container Symfony\Component\Form\Extension\Core\Type\IntegerType form.type.language container Symfony\Component\Form\Extension\Core\Type\LanguageType form.type.locale container Symfony\Component\Form\Extension\Core\Type\LocaleType form.type.money container Symfony\Component\Form\Extension\Core\Type\MoneyType form.type.number container Symfony\Component\Form\Extension\Core\Type\NumberType form.type.password container Symfony\Component\Form\Extension\Core\Type\PasswordType form.type.percent container Symfony\Component\Form\Extension\Core\Type\PercentType form.type.radio container Symfony\Component\Form\Extension\Core\Type\RadioType form.type.repeated container Symfony\Component\Form\Extension\Core\Type\RepeatedType form.type.reset container Symfony\Component\Form\Extension\Core\Type\ResetType form.type.search container Symfony\Component\Form\Extension\Core\Type\SearchType form.type.submit container Symfony\Component\Form\Extension\Core\Type\SubmitType form.type.text container Symfony\Component\Form\Extension\Core\Type\TextType form.type.textarea container Symfony\Component\Form\Extension\Core\Type\TextareaType form.type.time container Symfony\Component\Form\Extension\Core\Type\TimeType form.type.timezone container Symfony\Component\Form\Extension\Core\Type\TimezoneType form.type.url container Symfony\Component\Form\Extension\Core\Type\UrlType form.type_extension.csrf container Symfony\Component\Form\Extension\Csrf\Type\FormTypeCsrfExtension form.type_extension.form.http_foundation container Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension form.type_extension.form.validator container Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension form.type_extension.repeated.validator container Symfony\Component\Form\Extension\Validator\Type\RepeatedTypeValidatorExtension form.type_extension.submit.validator container Symfony\Component\Form\Extension\Validator\Type\SubmitTypeValidatorExtension form.type_guesser.doctrine container Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser form.type_guesser.validator container Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser fragment.handler container Symfony\Component\HttpKernel\Fragment\FragmentHandler fragment.listener container Symfony\Component\HttpKernel\EventListener\FragmentListener fragment.renderer.hinclude container Symfony\Bundle\FrameworkBundle\Fragment\ContainerAwareHIncludeFragmentRenderer fragment.renderer.inline container Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer http_kernel container Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel kernel container locale_listener container Symfony\Component\HttpKernel\EventListener\LocaleListener logger container Symfony\Bridge\Monolog\Logger mailer n/a alias for swiftmailer.mailer.default monolog.handler.chromephp container Symfony\Bridge\Monolog\Handler\ChromePhpHandler monolog.handler.debug container Symfony\Bridge\Monolog\Handler\DebugHandler monolog.handler.firephp container Symfony\Bridge\Monolog\Handler\FirePHPHandler monolog.handler.main container Monolog\Handler\StreamHandler monolog.logger.deprecation container Symfony\Bridge\Monolog\Logger monolog.logger.doctrine container Symfony\Bridge\Monolog\Logger monolog.logger.emergency container Symfony\Bridge\Monolog\Logger monolog.logger.event container Symfony\Bridge\Monolog\Logger monolog.logger.profiler container Symfony\Bridge\Monolog\Logger monolog.logger.request container Symfony\Bridge\Monolog\Logger monolog.logger.router container Symfony\Bridge\Monolog\Logger monolog.logger.security container Symfony\Bridge\Monolog\Logger monolog.logger.templating container Symfony\Bridge\Monolog\Logger profiler container Symfony\Component\HttpKernel\Profiler\Profiler profiler_listener container Symfony\Component\HttpKernel\EventListener\ProfilerListener property_accessor container Symfony\Component\PropertyAccess\PropertyAccessor request request response_listener container Symfony\Component\HttpKernel\EventListener\ResponseListener router container Symfony\Bundle\FrameworkBundle\Routing\Router router_listener container Symfony\Component\HttpKernel\EventListener\RouterListener routing.loader container Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader security.context container Symfony\Component\Security\Core\SecurityContext security.encoder_factory container Symfony\Component\Security\Core\Encoder\EncoderFactory security.firewall container Symfony\Component\Security\Http\Firewall security.firewall.map.context.dev container Symfony\Bundle\SecurityBundle\Security\FirewallContext security.firewall.map.context.login container Symfony\Bundle\SecurityBundle\Security\FirewallContext security.firewall.map.context.rest container Symfony\Bundle\SecurityBundle\Security\FirewallContext security.firewall.map.context.secured_area container Symfony\Bundle\SecurityBundle\Security\FirewallContext security.rememberme.response_listener container Symfony\Component\Security\Http\RememberMe\ResponseListener security.secure_random container Symfony\Component\Security\Core\Util\SecureRandom security.validator.user_password container Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator sensio.distribution.webconfigurator n/a alias for sensio_distribution.webconfigurator sensio_distribution.webconfigurator container Sensio\Bundle\DistributionBundle\Configurator\Configurator sensio_framework_extra.cache.listener container Sensio\Bundle\FrameworkExtraBundle\EventListener\CacheListener sensio_framework_extra.controller.listener container Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener sensio_framework_extra.converter.datetime container Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter sensio_framework_extra.converter.doctrine.orm container Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter sensio_framework_extra.converter.listener container Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener sensio_framework_extra.converter.manager container Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager sensio_framework_extra.view.guesser container Sensio\Bundle\FrameworkExtraBundle\Templating\TemplateGuesser sensio_framework_extra.view.listener container Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener service_container container session container Symfony\Component\HttpFoundation\Session\Session session.handler container Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler session.storage n/a alias for session.storage.native session.storage.filesystem container Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage session.storage.native container Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage session.storage.php_bridge container Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage session_listener container Symfony\Bundle\FrameworkBundle\EventListener\SessionListener streamed_response_listener container Symfony\Component\HttpKernel\EventListener\StreamedResponseListener swiftmailer.email_sender.listener container Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener swiftmailer.mailer n/a alias for swiftmailer.mailer.default swiftmailer.mailer.default container Swift_Mailer swiftmailer.mailer.default.plugin.messagelogger container Swift_Plugins_MessageLogger swiftmailer.mailer.default.spool container Swift_FileSpool swiftmailer.mailer.default.transport container Swift_Transport_SpoolTransport swiftmailer.mailer.default.transport.real container Swift_Transport_EsmtpTransport swiftmailer.plugin.messagelogger n/a alias for swiftmailer.mailer.default.plugin.messagelogger swiftmailer.spool n/a alias for swiftmailer.mailer.default.spool swiftmailer.transport n/a alias for swiftmailer.mailer.default.transport swiftmailer.transport.real n/a alias for swiftmailer.mailer.default.transport.real templating container Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine templating.asset.package_factory container Symfony\Bundle\FrameworkBundle\Templating\Asset\PackageFactory templating.filename_parser container Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser templating.globals container Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables templating.helper.actions container Symfony\Bundle\FrameworkBundle\Templating\Helper\ActionsHelper templating.helper.assets request Symfony\Component\Templating\Helper\CoreAssetsHelper templating.helper.code container Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper templating.helper.form container Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper templating.helper.logout_url container Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper templating.helper.request container Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper templating.helper.router container Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper templating.helper.security container Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper templating.helper.session container Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper templating.helper.slots container Symfony\Component\Templating\Helper\SlotsHelper templating.helper.translator container Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper templating.loader container Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader templating.name_parser container Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser translation.dumper.csv container Symfony\Component\Translation\Dumper\CsvFileDumper translation.dumper.ini container Symfony\Component\Translation\Dumper\IniFileDumper translation.dumper.mo container Symfony\Component\Translation\Dumper\MoFileDumper translation.dumper.php container Symfony\Component\Translation\Dumper\PhpFileDumper translation.dumper.po container Symfony\Component\Translation\Dumper\PoFileDumper translation.dumper.qt container Symfony\Component\Translation\Dumper\QtFileDumper translation.dumper.res container Symfony\Component\Translation\Dumper\IcuResFileDumper translation.dumper.xliff container Symfony\Component\Translation\Dumper\XliffFileDumper translation.dumper.yml container Symfony\Component\Translation\Dumper\YamlFileDumper translation.extractor container Symfony\Component\Translation\Extractor\ChainExtractor translation.extractor.php container Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor translation.loader container Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader translation.loader.csv container Symfony\Component\Translation\Loader\CsvFileLoader translation.loader.dat container Symfony\Component\Translation\Loader\IcuResFileLoader translation.loader.ini container Symfony\Component\Translation\Loader\IniFileLoader translation.loader.mo container Symfony\Component\Translation\Loader\MoFileLoader translation.loader.php container Symfony\Component\Translation\Loader\PhpFileLoader translation.loader.po container Symfony\Component\Translation\Loader\PoFileLoader translation.loader.qt container Symfony\Component\Translation\Loader\QtFileLoader translation.loader.res container Symfony\Component\Translation\Loader\IcuResFileLoader translation.loader.xliff container Symfony\Component\Translation\Loader\XliffFileLoader translation.loader.yml container Symfony\Component\Translation\Loader\YamlFileLoader translation.writer container Symfony\Component\Translation\Writer\TranslationWriter translator n/a alias for translator.default translator.default container Symfony\Bundle\FrameworkBundle\Translation\Translator twig container Twig_Environment twig.controller.exception container Symfony\Bundle\TwigBundle\Controller\ExceptionController twig.exception_listener container Symfony\Component\HttpKernel\EventListener\ExceptionListener twig.loader container Symfony\Bundle\TwigBundle\Loader\FilesystemLoader twig.translation.extractor container Symfony\Bridge\Twig\Translation\TwigExtractor uri_signer container Symfony\Component\HttpKernel\UriSigner bla_orm.listener container Bla\OrmBundle\EventListener\UserManager validator container Symfony\Component\Validator\Validator web_profiler.controller.exception container Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController web_profiler.controller.profiler container Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController web_profiler.controller.router container Symfony\Bundle\WebProfilerBundle\Controller\RouterController web_profiler.debug_toolbar container Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener Update It seems that the listener is not invoked when an updateAction, generated by generate:doctrine:crud has taken place though. At another part of the code the lister seems to be invoked. Though, there are both Controller types and both us $em->persist($something); $em->flush(); to save the changes. I would expect that in both cases the listener is invoked.

    Read the article

  • What is the structure of a (Data Access) Service Class

    - by jiewmeng
    I learnt that I should be using service classes to persist entities into the database instead of putting such logic in models/controllers. I currently made my service class something like class Application_DAO_User { protected $user; public function __construct(User $user) { $this->user = $user } public function edit($name, ...) { $this->user->name = $name; ... $this->em->flush(); } } I wonder if this should be the structure of a service class? where a service object represents a entity/model? Or maybe I should pass a User object everytime I want to do a edit like public static function edit($user, $name) { $user->name = $name; $this->em->flush(); } I am using Doctrine 2 & Zend Framework, but it shouldn't matter

    Read the article

  • SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters

    - by Gremo
    Weird error and this is driving me crazy all the day. To me it seems a bug because there are no positional parameters in my query. Here is the method: public function getAll(User $user, DateTime $start = null, DateTime $end = null) { $params = array('user_id' => $user->getId()); $rsm = new \Doctrine\ORM\Query\ResultSetMapping(); // Result set mapping $rsm->addScalarResult('subtype', 'subtype'); $rsm->addScalarResult('count', 'count'); $sms_sql = "SELECT CONCAT('sms_', IF(is_auto = 0, 'user' , 'auto')) AS subtype, " . "SUM(messages_count * (customers_count + recipients_count)) AS count " . "FROM outgoing_message AS m INNER JOIN small_text_message AS s ON " . "m.id = s.id WHERE status <> 'pending' AND user_id = :user_id"; $news_sql = "SELECT CONCAT('news_', IF(is_auto = 0, 'user' , 'auto')) AS subtype, " . "SUM(customers_count + recipients_count) AS count " . "FROM outgoing_message AS m JOIN newsletter AS n ON m.id = n.id " . "WHERE status <> 'pending' AND user_id = :user_id"; if($start) : $sms_sql .= " AND sent_at >= :start"; $news_sql .= " AND sent_at >= :start"; $params['start'] = $start->format('Y-m-d'); endif; $sms_sql .= ' GROUP BY type, is_auto'; $news_sql .= ' GROUP BY type, is_auto'; return $this->_em->createNativeQuery("$sms_sql UNION ALL $news_sql", $rsm) >setParameters($params)->getResult(); } And this throws the exception: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters Array $arams is OK and so generated SQL: var_dump($params); array (size=2) 'user_id' => int 1 'start' => string '2012-01-01' (length=10) Strangest thing is that it works with "$sms_sql" only! Any help would make my day, thanks. Update Found another strange thing. If i change only the name (to start_date instead of start): if($start) : $sms_sql .= " AND sent_at >= :start_date"; $news_sql .= " AND sent_at >= :start_date"; $params['start_date'] = $start->format('Y-m-d'); endif; What happens is that Doctrine/PDO says: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sent1rt_date' in 'where clause' ... as string 1rt was added in the middle of the column name! Crazy...

    Read the article

  • ZF1 + Doctrine 2 ODM: Call to undefined method AnnotationReader::setDefaultAnnotationNamespace

    - by Rafael
    I am trying to setup a zf1 + doctrine mongo odm 1.0.0BETA4-DEV project. I am using https://github.com/Bittarman/zf-d2-odm branch but when I update doctrine version from 1.0.0BETA3 to 1.0.0BETA4-DEV, I get the following error: SCREAM: Error suppression ignored for ( ! ) Fatal error: Call to undefined method Doctrine\Common\Annotations\AnnotationReader::setDefaultAnnotationNamespace() in C:\htdocs\zf-d2-odm\library\Lupi\Resource\Odm.php on line 34 Call Stack # Time Memory Function Location 1 0.0007 139368 {main}( ) ..\index.php:0 2 0.0217 659008 Zend_Application->bootstrap( ) ..\index.php:25 3 0.0217 659104 Zend_Application_Bootstrap_BootstrapAbstract->bootstrap( ) ..\Application.php:355 4 0.0217 659120 Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap( ) ..\BootstrapAbstract.php:586 5 0.0314 1127240 Zend_Application_Bootstrap_BootstrapAbstract->_executeResource( ) ..\BootstrapAbstract.php:626 6 0.0314 1127368 Lupi_Resource_Odm->init( ) ..\BootstrapAbstract.php:683

    Read the article

  • Correct way to set the driverOptions for Doctrine DBAL configuration in symfony2

    - by yesIcan
    I have set driverOptions in the config file as mentioned in the doctrine DBAL documentation. But this gives and error 1/1 InvalidConfigurationException: Unrecognized options "driverOptions" under "doctrine.dbal.connections.pdoDevCon" My config file is dbal: default_connection: pdoDevCon connections: pdoDevCon: driver: %dev_database_driver% # < host: %dev_database_host% # | port: %dev_database_port% # | Defined in user: %dev_database_user% # | password: %dev_database_password% # < charset: UTF8 driverOptions: {3: 2} mapping_types: enum: string set: string orm: auto_generate_proxy_classes: %kernel.debug% pdoDevCon: connection: pdoDevCon mappings: AcmeDemoBundle: ~ AcmeHelloBundle: ~ I am using PDO::ATTR_ERRMODE as 3 PDO::ERRMODE_EXCEPTION as 2, it does not work even if i use the strings.

    Read the article

1 2  | Next Page >