Doctrine 2: How to search for an entity by its association's value?

stackoverflow.com - 2012-03-29 22:55:01 - Similar - Report/Block

Let's say I have an Account entity, and an AccountData entity (which stores some less used properties, like gender, etc). The relationship between Account and AccountData is one-to-one, and the Account "owns" AccountData. I'm trying to figure out, using Doctrine 2 / Symfony 2, how to pull up an Account according to a property in AccountDa...

Problems with copying an entity objects with its association

stackoverflow.com - 2012-05-09 19:52:34 - Similar - Report/Block

I am using MVC with Entity Framework Model First. I have a Entity GoalCard and this Entity is associated to another entity SelectedQuestion The association is following: GoalCard 1...Many SelectedQuestion What I want to achieve is to duplicate a goalcard object and its values and also make sure that the association entity gets that aswe...

How to configure Doctrine entities to handle compressed blobs in the database?

stackoverflow.com - 2012-03-08 11:54:15 - Similar - Report/Block

I'm using Doctrine 2 as an ORM to the database and i'm having an issue with compressed blobs. I'm storing text in a compressed blob column in the database. How can i specify this in the entity mapping xml config? I'm currently using type="blob" for this column but this isn't returning a string. I could use type="text" but this returns g...

ManyToOne mapping with Doctrine and undefined index warnings

stackoverflow.com - 2012-07-05 16:36:58 - Similar - Report/Block

I'm sure there's a simple solution to this, but I can't fathom what's going on. I have an entity called a Payment and two other entities called Household has many Payment s and and a Household has many Payment s. This is all mapped as unidirectional manyToOne relationships of the Payment using YAML, like this (hopefully this is in lin...

Doctrine 2 and codeigniter 2, how to use generated code

stackoverflow.com - 2012-06-27 07:24:50 - Similar - Report/Block

Working a few months with CodeIgniter, newbe with Doctrine. I work recently with https://github.com/wildlyinaccurate/Code Igniter-2-with-Doctrine-2 as the base and defining entities from mysql table/columns with generate_classes() function ( application/libraries/Doctrine.php, called once before constructor ends, comment it after entitie...

How to make dynamic associations in Doctrine based on dynamic variable?

stackoverflow.com - 2012-04-27 10:48:52 - Similar - Report/Block

Im quite new to doctrine2. I need to make a connection like this: Tag has a (abstract) resource connected. (abstract) resource has tags. I want to danamicly type the object of the Entity resource based on code. So this way I can attach tags to any entity that implements given interface. Im using Zend Framework and annotations docblock sty...

Do Many-To-Many relationships required a "join entity" in Symfony 2 / Doctrine?

stackoverflow.com - 2012-05-08 01:36:56 - Similar - Report/Block

I am starting to understand how Symfony 2 and Doctrine handle many to many relationships, but I am stuck on something, that I seem to have read differing opinions on. Let's say I have an Author entity and a Book entity...with a many-to-many relationship between them. In my database, I represent this with three tables, an authors table, a...

Possible to generate entity class based on YML file?

stackoverflow.com - 2012-04-20 00:14:52 - Similar - Report/Block

I'd like to create an entity class based on meta data stored in a YML file. Is this (easily) possible? I've been digging around the Doctrine library, and found Doctrine\ORM\Tools\EntityGenerator Doctrine\ORM\Mapping\ClassMetadataInfo , but I haven't quite figured out how to properly use them, or even if they're they classes I should be u...

Symfony2 + Doctrine2: Filter an entity based on properties of an association with inheritance

stackoverflow.com - 2012-05-12 03:06:37 - Similar - Report/Block

I'm trying to filter a list of "Client" entities based on properties of an associated entity called Account. The problem is that the Account entity it's just a base class and the actual properties for filtering lives in their child entities (PersonalAccount and EnterpriseAccount) but doctrine only let my access properties of the Account b...

Doctrine Cli WIndows

stackoverflow.com - 2013-03-26 01:28:42 - Similar - Report/Block

I am having some trouble configuring doctrine orm on windows 8, php 5.4. I have installed Doctrine using Composer. I have followed the docs to the letter but when I run any commands, php vendor/bin/doctrine orm:schema-tool:create for example, my command line just outputs SRC_DIR="`pwd`" cd "`dirname "$0"`" cd "../doctrine/orm/bin" BIN_TAR...

OneToMany relationship accessed in both side?

stackoverflow.com - 2012-07-08 19:32:23 - Similar - Report/Block

In entity framework.. when you apply an association in fluent mapping in one side of the association does both sides of the association get automatically generated by EF ? If you take as example an OneToMany relationship. If i apply the association between X and Y in the fluent mapping configuration of X does this also apply at the Y side...

How to select randomly with doctrine

stackoverflow.com - 2012-05-26 01:51:24 - Similar - Report/Block

Hi Here is how I query my database for some words $query = $qb->select('w')->from('DbEntities \Entity\Word', 'w')->where('w.indictionary = 0 AND w.frequency > 3')->orderBy('w.frequency', 'DESC')->getQuery()->setMaxResults (100); I'm using mysql and I'd like to get random rows that match the criteria, I would use order...

evolveStar Join

how to set date in controller symfony

stackoverflow.com - 2012-05-31 16:59:09 - Similar - Report/Block

i have a field nammed "birthday" in doctrine entity. i wanna create an object to add to database using doctrine. inside the controller : $name = "John Alex"; $birthday = "11-11-90"; $student = new Student(); $student->setName($name); $student->setBirthday(strtotime($birt hday); but when i try to persist i get this error Fatal error:...

Doctrine 2 inject data to loaded models

stackoverflow.com - 2012-02-24 21:43:53 - Similar - Report/Block

I have a Doctrine 2 model which has a relation to a file system model (MogileFS) which I've implemented using a model/mapper approach. What I'm trying to accomplish is to lazy load the non-doctrine model from a Doctrine 2 entity, and inject a mapper object into this model while doing so. Example: use Doctrine\ORM\Tools\Pagination\Paginato.. .

Event-based extension of query builder in Doctrine repository

stackoverflow.com - 2012-05-22 10:51:07 - Similar - Report/Block

I have a Doctrine entity which is loaded by module . The page is a nested set provided by the Gedmo Doctrine Extension . The module has another model Metadata , 1:1 related to a page. I would like to join the metadata directly when loads the tree. So inside module $em->getRepository('My\Entity\Page')- >getRootNodes(); This loads a...

How to access the Entity Manager inside of the KnpMenuBundle?

stackoverflow.com - 2012-02-27 13:18:26 - Similar - Report/Block

I am using the KnpMenuBundle and would like to access the Doctrine Entity Manager inside of the menu Builder class. I want to check the database for some different values that might need to appear in the menu. I tried passing the EM through a constructor but it doesn't work. What's the best way to accomplish this? Thanks! Here's the c...

Doctrine 2 in Symfony 2 - Filtering a QueryBuilder by an association

stackoverflow.com - 2012-04-14 02:25:41 - Similar - Report/Block

I have my two classes , and I need to make a QueryBuilder which returns a query for the users who have the ROLE_PROVIDER role. I need this for an entity form field in Symfony 2. In the Form Class definition I have the following snippet for the mentioned field: $builder->add('provider', 'entity', array( 'class' => 'ElCuadreAccount...

Symfony2 & Doctrine2 PDOException without description

stackoverflow.com - 2012-04-13 13:26:02 - Similar - Report/Block

I wanted to use this code, and it break on flush() without any exception message: 1. at PDOStatement ->execute (null) in ../vendor/doctrine-dbal/lib/Doctrine/DBA L/Statement.php at line 131 2. at Statement ->execute () in ../vendor/doctrine/lib/Doctrine/ORM/Pers isters/BasicEntityPersister.php at line 237 3. at BasicEntityPersister...

Doctrine2.1: Finding by DiscriminatorColumn results in "Unknown field" exception

stackoverflow.com - 2012-05-11 14:00:30 - Similar - Report/Block

I've tried to search for this error but the fact that I haven't found anything leads me to believe that I'm doing something silly. I'll include the relevant code below, but basically I'm using multiple table inheritance (or Class Table Inheritance ) and trying to use the Doctrine ORM findBy() method to query based on the discriminator col...

Symfony2 Event_listener not firing

stackoverflow.com - 2012-03-14 00:00:13 - Similar - Report/Block

I am using Symfont RC5 and I'm trying to get event listener prePersist to fire. In app/config/config,yml I have:- services: recordmanagement: class: FNQITServices\BMBundle\Listener\RecordMa nagement tags: - { name: doctrine.event_listener, event: prePersist } And I created a class src/FNQITServices/BMBundle/Listener/...

Entity Framework: Update entity or add if it doesn't exist

stackoverflow.com - 2011-06-22 04:56:38 - Similar - Report/Block

I have a scenario where I have to update an entity if it exists or add a new one if it doesn't. I would like to execute a single method for this (it would be great if it were a single trip to the server). Is there something like that in EF? Right now my code looks like this: var entity = db.Entities.FirstOrDefault(e => e.Id == myId); i...

Doctrine Bidirectional ManyToMany relationship issue

stackoverflow.com - 2012-07-23 18:32:21 - Similar - Report/Block

I already have read carefully through Doctrine documentation , but I'm unable to set up a Many to Many bidirectional relationship in version 2.2. Here is the code: Attachment Entity * @ORM\Entity * @ORM\Table(name="attachment") * @ORM\HasLifecycleCallbacks class Attachment * @var ArrayCollection $users * @ORM\ManyToMany(targetEntity=...

Hints and tutorial with Symfony2 Doctrine?

stackoverflow.com - 2012-02-20 06:41:19 - Similar - Report/Block

I am practising with symfony2, I have completed the Symblog Tutorial And Now I have stated creating my own small application. I have created a registration form and Login form. Now I have a lot of doubts about the doctrine queries set, I have never used an MVC architecture. How to write these queries and where I need to write them. Do I n...

Return selected columns from a query in Doctrine 2/ZF

stackoverflow.com - 2012-03-11 18:23:26 - Similar - Report/Block

I am using Doctrine 2 to manage my entity and Zend_Auth to manage authorisation. I can easily get a full details of a user using $user = $this->em->getRepository('Entities \User')->findOneByUsername($username) ); I successfully authorise, and then want to store the user so that I can access certain details $storage = $auth->getS...

symfony2: how to write the methods for a many to many relationship?

stackoverflow.com - 2012-05-14 20:49:46 - Similar - Report/Block

I've created these two models below (Author and Book) associated through a many to many relationship. Then I have generated the crud methods. The problem: when I try to create or save an author using the new or edit form, it doesn't save the books. namespace Prueba\FrontendBundle\Entity; use \Doctrine\Common\Collections\ArrayCollec tion; u...

using SoapClient,ArrayObject, ArrayIterator causes error in zend framework

stackoverflow.com - 2012-07-07 22:18:35 - Similar - Report/Block

I'm working on some helpful method in my entity. private function setApi($api_address,$api_username,$api_p assword){ $this->api_address = $api_address; $this->api_username = $api_username; $this->api_password = $api_password; $this->api_client = new SoapClient($api_address); // error Warning: require(App/Entity/SoapClient.p...

Symfony2 & Doctrine avoid many-to-one persist double

stackoverflow.com - 2013-02-18 11:59:46 - Similar - Report/Block

I'm desperately looking for an answer, but can not find it! I have a form that invokes a choice field entity in one-to-many relationship with another entity: class MailTelCont //.. /** * @ORM\ManyToOne(targetEntity="Typea", inversedBy="mailTelContacts", cascade={"persist"}) * @ORM\JoinColumn(name="type_id", referencedColumnName="id") *...

Zend Framework 2 - How to configure bjyauthorize for Doctrine

stackoverflow.com - 2013-03-13 10:05:02 - Similar - Report/Block

The bjyauthorize doc says that there is a way to configure it for Doctrine. By default, it provides simple setup via config files or by using Zend\Db or Doctrine ORM/ODM (via ZfcUserDoctrineORM). But the module itself doesn't contain any entities and I didn't found how to set it up. Does anybody know a step-by-step tutorial for setting i...

No matching global declaration available for the validation root Symfony

stackoverflow.com - 2013-05-05 06:13:16 - Similar - Report/Block

I am trying to implemment doctrine annotations as XML, but i am getting this error: Element '{http://doctrine-project.org/schemas/or m/doctrine-mapping}doctrine-mapping': No matching global declaration available for the validation root This is my XML: and these are my extensions: $loader = new Loader\XmlFileLoader($container, new FileLocat...

Doctrine 2.2 HYDRATE_OBJECT extremely slow compared to HYDRATE_ARRAY

stackoverflow.com - 2012-06-09 18:54:36 - Similar - Report/Block

I'm struggling with Doctrine 2 performce when using HYDRATE_OBJECT . When I switch from HYDRATE_ARRAY HYDRATE_OBJECT , it takes nearly 10 times longer! I've used doctrine 2 and zend paginator as reference: $query = $em->createQuery($dql) ->setHydrationMode(\Doctrine\ORM\Abst ractQuery::HYDRATE_ARRAY) ->setParameter('x', 1); //...

Entity Framework 4 - Notification on Associations

stackoverflow.com - 2012-04-25 00:14:55 - Similar - Report/Block

I am facing a few difficulties with EF 4, foreign keys and INotifyPropertyChanged / the partial methods exposed for scalar properties. I hope you can help me find the right way to do this. Image I have a Customer entity with *..1 relationship with the Country entity. Now, I'd obviously like to be able to do: var customer = new Customer();...

Symfony 2 - Set UniqueEntity message

stackoverflow.com - 2013-03-05 10:42:09 - Similar - Report/Block

I have a Symfony 2/Doctrine 2 entity with a UniqueEntity constraint. As show in the documentation, it should be possible to set a custom error message. I tied the following syntax, but that dose not work: /** * @ORM\Entity * @ORM\Table(name="User") * @UniqueEntity("email", message="Your E-Mail adress has already been registered") */...

XSLT Removing nodes not in a list while keeping any child nodes that are in a list

stackoverflow.com - 2013-05-01 22:42:19 - Similar - Report/Block

I have a list of ids that I want to use to 'filter' a supplied xml file. Each node in the list should be kept, and every node not in the list removed. The difficulty for me is when I remove a node (not in the IDList), I also end up removing a child node that may be in the IDList. Last of all, I need to keep the nesting of the nodes (see m...

Doctrine2 migrations inside Symfony2 throw Exception on index creation

stackoverflow.com - 2013-03-20 09:50:49 - Similar - Report/Block

The problem With no previous migration pending I run: app/console doctrine:migration:diff app/console doctrine:migration:migrate I got this error: ALTER TABLE session ADD CONSTRAINT FK_9955C22EA76ED395 FOREIGN KEY (user_id) REFERENCES user(id) Migration 20130320103822 failed during Execution. Error SQLSTATE[HY000]: General error: 1005 Can...

eclipselink 2 OneToMany with one association table how to delete from one side

stackoverflow.com - 2012-05-29 20:53:37 - Similar - Report/Block

i have the following entity relationship: SideA: @Entity @Table(name = "SideA") public class SideA { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; @CascadeOnDelete @OneToMany(fetch = FetchType.LAZY, mappedBy = "sideA", cascade=CascadeType.ALL) private List<ABAssociation> association = new ArrayList<A...

How to get entityManager by using an entity class

stackoverflow.com - 2013-04-09 11:18:02 - Similar - Report/Block

How to reach the entity manager which managed the entity. I mean; suppose that i have an entity reference in the sessionBean, how can i get entityManager of this entity belonged one? Thx bgrds...

Save a file as a BLOB with Doctrine

stackoverflow.com - 2012-04-30 16:35:05 - Similar - Report/Block

I use Symfony2 with Doctrine 2.2.2 and a Oracle Database. I want to save a file as a BLOB in the Oracle DB. I wrote a costum Type for Doctrine to have a BLOB Type. It look's like this: class Blob extends Type const BLOB = 'blob'; public function convertToPHPValue($value, AbstractPlatform $platform) return (is_resource($value)) ? stream_g...

Doctrine2: dynamic entity associations

stackoverflow.com - 2012-03-29 00:59:38 - Similar - Report/Block

I have a Entity called Event which has a field containing the class name of another Entity in the Bundle a field targetId of that Entity I would like to access this target entity inside my Event-Entity somehow but im now sure how to do it. I'd like to access the different target Entities in a twig template using something like {% if event...

Form mit Doctrine 2 Entity verbinden

zfforum.de - 2013-03-06 09:58:08 - Similar - Report/Block

Hallo, ich habe ein Problem ein Form mit einem Doctrine 2 Entity mittels eines Hydrator zu verbinden. MyRestfulController.php PHP-Code: public function create $data ) { # create a new, empty entity $message = new Message (); # create the form $form = new \ MyNamesspace Form MessageCreateForm # set the hydrator to connect form and entity $...

[Doctrine] Une jointure créée une boucle de Select

developpez.net - 2013-02-22 11:54:04 - Similar - Report/Block

Bonjour, J'ai un petit souci avec une requête que j'ai implémentée dans une classe repository (je précise que je débute en Symfony2 et Doctrine). Je vous expose le problème : ce qui pour moi ne représentait qu'une requête est traitée en 5 requêtes SQL par Doctrine. Voilà le code de ma fonction : Code: public function findHobbiesByUser(\Mc...


Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.

Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !

evolveStar.com provides a search engine that allows you to gather information to write their own blog.

evolveStar.com enhances the sources displaying the logo of the site.

If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com

Specifies the subject copyright violation and the url of the page

evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.

Next will be effectual and relevant checks.

Who We Are Partner Advertising Contacts Privacy terms Help & FAQ

© Copyright 2010-2017 Fabrizio Fichera. All rights reserved.