doctrine2

Doctrine 2.0 integration into Zend Framework 1.10

Hi, can anybody help me how to nice integrate doctrine 2.0 into ZF 1.10? I found some application resources, but there was no complete solution. Many thanks ...

Getting an undefined id exception when using Doctrine 2.0

Please see the code here: http://pastie.org/1092106 When I call the method createPost on Blog, I keep getting an exception, it reads as follows: At line 474 in lib/Doctrine/ORM/Persisters/BasicEntityPersister.php - Undefined index: id OH, and also... I regenerate $_SESSION['User'] on each page load, so the object isn't detached from ...

Doctrine2: Best way to handle many-to-many with extra columns in reference table

I'm wondering what's the best, the cleanest and the most simply way to work with many-to-many relations in Doctrine2. Let's assume that we've got an album like Master of Puppets by Metallica with several tracks. But please note the fact that one track might appears in more that just one album like Battery by Metallica does - three albu...

require_once missing doctrine zend framework

I'm integrating doctrine with Zend Framework. I've hit an error thrown from cli. It seems Zend_Application_Bootstrap_Bootstrap does not have a require_once for Zend_Application_Bootstrap_BootstrapAbstract. Has anyone hit this? my cli-config.php <?php $classLoader = new \Doctrine\Common\ClassLoader('App', __DIR__ . "/../application/mod...

Zend and static class properties

Hi all, I'm trying to assign a value to a static class property when defining it: namespace Base; abstract class Skeleton { protected static $entityManager = \Zend_Registry::get("EntityManager"); ... } When I try to execute this code I get this error: Parse error: syntax error, unexpected '(', expecting ',' or ';' in /var/w...

doctrine2 zend framework namespaceing controllers

I'm trying to integrate the doctrine2 sandbox with a default Zend Framework App. When I try to use namespacing in the controller I get an 'Invalid controller class ("IndexController")' error This Works: use Entities\User, Entities\Address; class IndexController extends Zend_Controller_Action { ... } This does not (but should?): na...

Doctrine 2 migrations how to alter a table with a sqlite db?

I'm having some issues with altering a table in the migrations of doctrine 2. Following code always throws the error: Operation 'Doctrine\DBAL\Platforms\AbstractPlatform::getAlterTableSQL' is not supported by platform. This is strange as alter table is supported by sqlite. public function up(Schema $schema) { $user = $schema->getTa...

How to drop a foreign key in doctrine 2 migrations

Hi all, I want to drop a foreign key in a doctrine 2 migration. But there is no dropForeignKeyConstraint() Does anybody know how to drop it? ...

How to handle exceptions on Doctrine 2 validation

I'm new to Doctrine 2 (and exceptions in PHP, really), but am trying to come up with a robust validation engine on Doctrine 2 (on top of CodeIgniter), following this page. Right now I'm wondering where I would define the ValidateException class, and how to 'try' doing a save (persist?) on my entity (from a controller, library, etc). I'...

doctrine2 sandbox dql

With the doctrine2 sandbox, what is the correct DQL to retrieve all users with address x? ...

Doctrine 2 Classloader weird behaviour - wrong paths to classes

Hi Guys, I'm having a bit of a problem with Classloader added to Doctrine 2 project. I have simple directory structure like this: config (bootstrap file) html (docroot with templates/images/js etc) php Entities (doctrine 2 entities) Responses (some transport objects) Services (processing api and business logic - like session beans in ...

doctrine2 remove ManyToMany relationship

I have a Group Entity with the following class member and mapping: /** * @ManyToMany(targetEntity="Group", cascade={"persist"}) * @JoinTable(name="groups_children", * joinColumns={@JoinColumn(name="group_id", referencedColumnName="id")}, * inverseJoinColumns={@JoinColumn(name="child_id", referencedColumnName="id", unique=t...

doctrine2 ldap DBAL driver

Are there any plans for an LDAP DBAL driver for doctrine2? driver docs ...

doctrine2 ArrayCollection error

I am trying to follow the advice from the doctrine docs on this page - initialising a class member with the ArrayCollection. All works well for the example given in the docs. I'm trying to do it with an inherited class but get an error saying: Class Doctrine\Common\Collections\ArrayCollection is not a valid entity or mapped super class ...

Custom Collection in Doctrine2

Just starting to work with Doctrine2, and am wondering how/if I can use a custom collection class. Searches point me to this part of the documentation: Collection-valued persistent fields and properties must be defined in terms of the Doctrine\Common\Collections\Collection interface. The collection implementation type may be used by ...

Doctrine mapping examples using PHPDriver

Hi, I am investigating Doctrine 2 for PHP and I am having trouble finding good resources for how to map using the PHPDriver. There is extensive documentation on using Annotations in comments for the Doctrine mappings, however, I would rather have my mapping definitions in PHP and NOT in comments (for obvious reasons). I could use some...

How to join table with itself in doctrine 2

is there any way using DQL write a query that joins table with itself? ...

doctrine2 can't connect to db?

I've been happily integrating Zend Framework and Doctrine for the past week or two. I've just rebuilt the db after updating my docblock annotations and now i get this mysterious error: Maximum execution time of 30 seconds exceeded in /Doctrine/DBAL/Connection.php on line 567 ?!? Any clues? ...

Is Doctrine2 compatible with PHP 5.3 up?

It seems doctrine 2 is compatible only with PHP 5.3 and up, and is NOT compatible with php versions before 5.3. Can someone confirm if this is true? ...

Doctrine 2 join troubles

Hi, I try to do this query using doctrine query builder $idAccount = $params['idAccount']; $qb = $this->_em->createQueryBuilder()->select('t,tt') ->from($this->_entityName, 'sr') ->innerJoin('sr.account', 'a') ->innerJoin('sr.product', 'p') ->leftJoin('p.title', 't') ...