doctrine

Fixtures and inheritance in Symfony

Hi! I have a database schema in Symfony like this: Persona: actAs: { Timestampable: ~ } columns: primer_nombre: { type: string(255), notnull: true } segundo_nombre: { type: string(255) } apellido: { type: string(255), notnull: true } rut: { type: string(255) } email: { type: string...

Doctrine Many to Many

Hello, I have a question about Doctrine ORM M:M. I built some tables like this: -User +id +name -Group +id +name I want to link these table via a new table with Doctrine: In Group class: $this->hasMany('User as Users', array( // I'm wondering what I can fill here 'refClass' => 'UserGroup' )); and in th...

difference between uni-directional and bi-directional relational relationship?

i wonder what these two words mean. i encountered them in Doctrine's documentation. but i cant understand what they mean. ...

what is repository in doctrine?

i wonder what a repository means in doctrine? could someone please explain? ...

Pre/post delete events aren't fired on refclass (many-to-many) in doctrine.

Is this a bug in Doctrine, or my wrong interpretaion? PS: Pre/post save events are fired correctly. ...

Doctrine: How to traverse from an entity to another 'linked' entity?

I'm loading 3 different tables using a cross-join in Doctrine_RawSql. This brings me back the following object: User -> User class (doctrine base class) Settings -> DoctrineCollection of Setting User_Settings -> DoctrineCollection of User_Setting The object above is the result of a many-to-many relationship b...

doctrine: QueryBuilder vs createQuery?

in doctrine you can create DQL in 2 ways: QueryBuilder: $query = $em->createQuery('SELECT u FROM MyProject\Model\User u WHERE u.id = ?1'); EntityManager::createQuery $qb->add('select', 'u') ->add('from', 'User u') ->add('where', 'u.id = ?1') ->add('orderBy', 'u.name ASC'); i wonder what the difference is and which you sho...

yaml files to create models are the same in Doctrine 2.0?

i wonder if the yaml files for creating models in Doctrine 2 are the same as those in Doctrine 1.2? ...

? in Doctrine query means?

i wonder what this query means: $blogPost = Doctrine_Query::create()->from('BlogPost p')->where('p.slug = ?', 'doctrine-released')->execute(); could someone explain the ? for me? thanks ...

doctrine cant find my BaseModels in the models/generated folder

when i use a Doctrine Model Doctrine cant find the BaseModel in the models/generated folder. what should i put in the Doctrine bootstrap file to tell it they are in the models/generated folder? thanks! ...

Doctrine_Record doesn't set PK in object after save()

Per documentation, Doctrine_Record after saving should set id of newly created record as object property. In my case, new record is created, but not value is set on object (while database has this new id value). What has caused this? $user1 = new ModelUsers(); $user1->save(); echo "last insert id=" . $user1->UserId; PS UserId is confi...

PHP Doctrine ORM - How can I set the caching of data dependable on a variable

Hi, I want to use the caching from Doctrin ORM for PHP. In the model classes how Can I cache the results of the query depending on the value of a flag. I do not want to change the signature of the current methods... Is there a way to set a global variable for the Doctrine ORM and to check that doctrine variable inside the model classe...

How can I specify that Doctrine must use a mysqli-connection

Hi, while executing a long script that uses Doctrine to access the db, I get an error 2006 server has gone away. I've already solved this problem on a website that doens't use Doctrine. The solution there was to use mysqli instead of the normal mysql driver. How can i tell Doctrine to use a mysqli-driver in order to avoid 2006-errors? ...

Doctrine CodeIgniter MySQL CRUD errors

EDIT: The cause of the errors (see below): my default primary key in doctrine_pi.php was "id", so I changed it to "book_id" (my database's primary key) and it worked. Thanks Marc B. Hi, I am using CI + Doctrine + MySQL and I am getting the following CRUD errors: (1) When trying to create a new record in the database with this code: ...

MySQL Queries using Doctrine & CodeIgniter

Hi, EDIT: The reason why my Doctrine queries (see below) did not work/produced those errors was because I left out ci_doctrine. when creating this database: CREATE TABLE `ci_doctrine`.`user` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , `username` VARCHAR( 255 ) NOT NULL , `password` VARCHAR( 255 ) NOT NU...

LIKE and % Wildcard in Doctrine's findBy*()

Hi, How do I write the following MySQL query using Doctrine's findBy*() method?: SELECT column_name1, column_name2 FROM table_name WHERE column_name3 LIKE '%search_key%'; For Example, to fetch multiple rows from a column named "ColumnName" (below) using Doctrine: $users = Doctrine::getTable('User')->findByColumnName('active'); echo...

Doctrine: Keep 'Timestampable' behavior when using stored procedures?

I have complex logic which is not possible (too slow) to run through PHP with Doctrine, so I need to create a stored procedure for this. The logic also includes inserting/updating records in a table using the Timestampable behavior. How do I preserve this behavior in the stored procedure? ...

Doctrine Default Primary Key Problem (Again)

EDIT: Paul Witschger (doctrine-user group) suggested I change the default primary key (system/application/plugins/doctrine_pi.php) back to 'id' and change any primary keys in my MySQL tables that differ from this. It worked. Thanks Hi, Should I change all of my uniquely-named MySQL database primary keys (for all tables that use Doctrin...

sfDoctrineGuard question

Hi, I'm trying to do a "i forgot my password" functionality. My problem is that if i try to do a Doctrine query and send password to email it retrieves password encrypted. I look at some webs that DoctrineGuard don't have this functionality and only have register and login functionality. Is it true? In this case, how i can do a rememb...

Count Records Returned MySQL Doctrine

Hi, How do I check the number of records returned from a search of my MySQL database with a statement like this: $searchKey = 'Something to search for'; $searchResults = Doctrine::getTable('TableName')->createQuery('t')- >where('columnName LIKE ?','%'.$searchKey.'%')->execute(); ...