doctrine

Cannot load entity: “class” was not found in the chain configured

我只是一个虾纸丫 提交于 2019-12-11 16:15:38
问题 I'm new to Doctrine ORM and I have some problems retrieving an entity. I get the following error when i try to retrieve my entity: 'AppBundle\Entity\FeedImport' was not found in the chain configured namespaces I've used the Symfony CLI utilities mapping:import to generate my entity yaml files and generate:entities for creating the models. I've searched for this error and most of the time it is all about custom bundles not being mapped correctly. But because I used the default bundle I don't

Doctrine 2 orm:schema-tool:create giving Runtime Exception: Too many arguments

半腔热情 提交于 2019-12-11 16:15:06
问题 i am trying out the Doctrine 2 sandbox. downloaded the main Doctrine 2 ORM from http://github.com/doctrine/doctrine2 the dbal from http://github.com/doctrine/dbal and common from http://github.com/doctrine/common . placed the packages in approparate folders ... D:\ResourceLibrary\Frameworks\Doctrine\lib\Doctrine\ORM D:\ResourceLibrary\Frameworks\Doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common D:\ResourceLibrary\Frameworks\Doctrine\lib\vendor\doctrine-dbal\lib\Doctrine\DBAL from the

Doctrine: authorize NULL in a foreign composite key

╄→гoц情女王★ 提交于 2019-12-11 16:14:56
问题 I have the following entity: /** * SeriesAuthorRole * * @ORM\Table() * @ORM\Entity(repositoryClass="Blog\Bundle\CoreBundle\Entity\SeriesAuthorRoleRepository") */ class SeriesAuthorRole extends AuthorRoleAbstract { /** * @var Series * * @ORM\ManyToOne(targetEntity="Blog\Bundle\CoreBundle\Entity\Series", inversedBy="authors") * @ORM\JoinColumn(name="series", referencedColumnName="id", nullable=false) * @ORM\Id */ private $series; /** * @var Author * * @ORM\ManyToOne(targetEntity="Blog\Bundle

How to use ApcuCache with Symfony, Doctrine ORM and DoctrineCacheBundle

江枫思渺然 提交于 2019-12-11 15:49:26
问题 before i was stuck with this problem the project was running on PHP5.6 on SF2.6. now im using PHP7.1.20 with SF2.8. i installed apcu along with apcu_bc inside my docker container and enabled the apcu php module. now the error is: UndefinedFunctionException in ApcCache.php line 35: Attempted to call function "apc_exists" from the global namespace. when i change the actual function calls inside of the loaded ApcCache-Class from apc_ to apcu_ everything works fine. inside Doctrine\Common\Cache

Symfony2, Doctrine, and forms - Persisting the data of both sides of a 1:* relationship in a single form

时光毁灭记忆、已成空白 提交于 2019-12-11 15:35:54
问题 In my Symfony2 project, I have a rather classic 1:* relationship with some of my entities (let's call them BlogPost and Comments, even though a NDC prevents me from saying what they really are). I've been tasked with modifying the form that currently exists to edit existing Comments so it can modify certain aspects of the BlogPost as well. I'm not entirely sure how to go about it, specifically with how Symfony2 and Doctrine handle their data binding. Right now, I populate and bind to the form

Zendframework 3 - Can't get entityManager on Application/Module

浪尽此生 提交于 2019-12-11 15:33:45
问题 I use Zendframework 3 and I have followed the tutorial for User authentication. In this project I'm able to connect to my database using entityManager. Then I created another project and copied the required code to make ORM work but I'm not able to retrieve information. I have read my code 1000 time, no error in log, every factory is correctly mapped. Here's my configuration: composer.json { "name": "zendframework/skeleton-application", "description": "Skeleton Application for Zend Framework

find the children of an object in the database

青春壹個敷衍的年華 提交于 2019-12-11 14:37:39
问题 I have an entity account which is a classic entity with children and parents. The way I did it, the SQL relation is identified only with the parents. What I want is to have for each object the list of its children. In plain old PHP, I would simply loop on a mysql_fetch_array to have all my accounts, and for each one request again to the DB where parent = id so and put that in the property children (array) of my account object. In Symfony2/doctrine, it seems I cannot do that, at least not that

Embedded forms in symfony 1.4 not saving properly

寵の児 提交于 2019-12-11 14:02:06
问题 I have the following model: WebPromocion: connection: doctrine tableName: WebPromocion columns: id: type: integer(4) fixed: false unsigned: true primary: true autoincrement: true nombre: type: string(100) fixed: false unsigned: false primary: false notnull: true autoincrement: false foto: type: integer(4) fixed: false unsigned: true primary: false notnull: true autoincrement: false flyer: type: integer(4) fixed: false unsigned: true primary: false notnull: true autoincrement: false desde:

Associated entity not merged correctly

不想你离开。 提交于 2019-12-11 13:58:18
问题 I have 2 associated entities like this: class Solicitation { <some fields> /** * @var \User * * @ORM\ManyToOne(targetEntity="User", fetch="EAGER", inversedBy="solicitation") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="id_user", referencedColumnName="id_user", nullable=false) * }) * @OrderBy({"nome" = "ASC"}) */ private $user; <more fields> } I don't want to cascade operations. The problem is when I try to merge an existing User before persisting Solicitation, like this: $em = $this-

Symfony 4 & Doctrine 2 serialize after removing (first) item from collection causes converting to JSON object instead of array

故事扮演 提交于 2019-12-11 13:32:04
问题 I'm having a lot of trouble with serializing collection from which I've removed first element. I have CompaniesCollection entity with Many2Many relation to Company entity. /** * @ORM\ManyToMany(targetEntity="App\Entity\Company") * @Groups({"get-by-collection-owner"}) */ private $items; When I fetch the object with that collection, I receive items as an array of two elements I've added in the first place. I serialize it { "id": 19, "name": "collection dummy name", "items": [ { "id": 431, "name