doctrine

unknown record property/related component “onwer” on “contact”

感情迁移 提交于 2019-12-12 03:47:58
问题 When I try to execute php symfony doctrine:data-load , this message apears : unknown record property/related component "owner" on "contact" this is my schema.yml : Contact: connection: doctrine tableName: contact columns: id_contact: type: integer(2) fixed: false unsigned: false primary: true autoincrement: true nom: type: string(30) fixed: false unsigned: false primary: false notnull: false autoincrement: false fonction_organisme: type: string(1000) fixed: false unsigned: false primary:

Order by “best match” based on relational tables values

风流意气都作罢 提交于 2019-12-12 03:40:05
问题 I have the following entity: Project Having multiple related tables: Project >-< ProjectAttribute >-< AttributeType Project >-< ProjectAttribute >-< AttributeValue Project >-< ProjectTask >------< Task Project >-< ProjectTask >------< Employee ... Involving about 15 tables including subjoins. Now I'm required to find the best matching Projects for a single Project given, by comparing the values and counting the occurrences. e.g. a match of AttributeType and AttributeValue increases the "best

Doctrine Deployment on test-environment without console-access

◇◆丶佛笑我妖孽 提交于 2019-12-12 03:39:25
问题 I developed an application with Zend Framework and Doctrine ORM. To test the application on another environment, I tried to install it on a Synology DiskStation. I exported the MySQL-database with phpMyAdmin and imported it to the DiskStation. But Doctrine doesn't detect the scheme either all login-credential are correct. So I tried to create the scheme with ssh-access: DiskStation> ./doctrine-module orm:schema-tool:create .../bin/doctrine-module: Permission denied Do you have any idea to

Can we extend entities in Doctrine?

房东的猫 提交于 2019-12-12 03:29:46
问题 I am working on my first project using Doctrine and I am stumbled on this. I have an entity User which is a mapped super class. /** * @ORM\MappedSuperclass */ abstract class User { /** * @var int */ protected $id; /** * @var string */ protected $name; /** * @ORM\Embedded(class="AppBundle\Entity\Person") * @var Person */ protected $person; /** * @var Authors[]|Collection|Selectable */ protected $authors; } I create an author entity from the User entity above class Author extends User { /** *

Doctrine FIND_IN_SET leads to Error: Expected end of string, got '('

霸气de小男生 提交于 2019-12-12 03:29:45
问题 I've got the following doctrine query in Symfony2: $query = $em ->createQuery(" SELECT m FROM MyBackendBundle:Merchant m WHERE m.active = :active ORDER BY FIND_IN_SET(m.range, 'all', 'without_special'), m.tradingAmount DESC ") ->setParameter('active', true) ; But this leads to the following error: [Syntax Error] line 0, col 112: Error: Expected end of string, got '(' and: QueryException: SELECT m FROM My\Bundle\BackendBundle\Entity\Merchant m WHERE m.active = :active ORDER BY FIND_IN_SET(m

A new entity was found through the relationship. Doctrine

夙愿已清 提交于 2019-12-12 03:23:20
问题 This question was migrated from Stack Overflow на русском because it can be answered on Stack Overflow. Migrated 4 years ago . The application has thrown an exception! Doctrine\ORM\ORMInvalidArgumentException A new entity was found through the relationship 'Core\Model\Filter#category' that was not configured to cascade persist operations for entity: Core\Model\Category@00000000314fc99200005639c0395a5e. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity

Issues in entities from different bundles using different entity managers

纵饮孤独 提交于 2019-12-12 03:19:32
问题 Edit: I've prepared a tar.gz which once uncompressed and after running ./bin/vendors install fails to load the fixtures through php scripts/createAll.php . In the tar.gz there are 2 bundles using 2 different connections everyone with its own database. I think Symfony2 fails to manage them properly. If you take a look at scripts/createAll.php will see how symfony fails to load both fixtures, but if you remove a random fixture (it doesn't matter Var_.php or Foo_.php everything runs fine, which

Error “No Metadata Classes to process.” when generating DB tables in Symfony (using Doctrine) created using php app/console doctrine:generate:entity

人走茶凉 提交于 2019-12-12 03:09:23
问题 Symfony newbie here! I installed Symfony and I made a controller and an action and some html is displayed properly. So, Symfony is working fine. I have a problem creating entity tables in the database. I created some entities using (annotations and some other way of making those - I tried couple of different ways of making entities through console, with same result). To create entities I used: php app/console doctrine:generate:entity And then, when I try to flush it to the database (in order

Define repository parameters in services.yml

一笑奈何 提交于 2019-12-12 02:57:40
问题 I'm trying to inject a repository into a service and for that purpose I'm defining services.yml file this way: parameters: user.repository.class: App\UserBundle\Repository\UserRepository user_repository.factory_argument: App\UserBundle\Usuario user_repository.factory_argument2: Doctrine\ORM\Mapping\ClassMetadata user.service.class: App\UserBundle\Services\UserServiceImpl services: app_user.registration.form.type: class: App\UserBundle\Form\Type\RegistrationFormType arguments: [%fos_user.model

Symfony2 Catchable Fatal Error: Object of class DateTime could not be converted to string

一世执手 提交于 2019-12-12 02:52:32
问题 I have a person (Employee) search that is supposed to return a list of people by name, surname, date of birth and some other parameters. the search works fine for every parameter exempt for the date parameters, like date of birth. my controller code is this: $aWorker = new Worker(); $searchWorkerForm = $this->createFormBuilder($aWorker) ->add('omang', 'text', array('required' => false)) ->add('workerName', 'text', array('required' => false)) ->add('workerSurname', 'text', array('required' =>