doctrine

Doctrine Fatal Error - Unknown relation alias

I am getting following error message: Doctrine_Table_Exception: Unknown relation alias shoesTable in /home/public_html/projects/giftshoes/system/database/doctrine/Doctrine/Relation/Parser.php on line 237 I am using doctrine 1.2.2 with Codeigniter My Code is below: (BaseShoes.php and Shoes.php is auto generated) ------------BaseShoes-...

Doctrine: Unknown table alias. Is this DQL correct?

I'm trying to execute a query but I get an error: Unknown table alias The tables are setup as follows: Template_Spot hasOne Template Template hasMany Template_Spot Template hasMany Location Location hasOne Template I'm trying to execute the following DQL: $locationid = 1; $spots = Doctrine_Query::create() -...

Data-separation in a Symfony Multi-tenant app using Doctrine

I am trying to implement a multi-tenant application, that is - data of all clients in a single database - each shared table has a tenant_id field to separate data I wish to achieve data separation by adding where('tenant_id = ', $user->getTenantID()) {pseudoc-code} to all SELECT queries I could not find any solution up-front, but here a...

Writing you own media library: where to start?

Hi, i'd like to add a media library to a custom-made CMS that is build on Zend Framework and Doctrine. The goal is to build something like Worpress's media library: you can upload media and then attach it to for example an article. Do you have any suggestions how to start on this? How should the database be designed? Is there any code...

Tag suggestion (not tag autocomplete)

AJAX autocomplete is fairly simple to implement. However, I wonder how to handle smart tag suggestion like this on SO. To clarify the difference between autocomplete and suggestion: autocomplete: foo [foobar, foobaz] suggestion: foo [barfoo, foobar, foobaz], or even better, with 'did you mean' feature: [barfoo, foobar, foobaz, fobar, ...

doctrine with mamp?

i want to use doctrine with my mamp. but according to doctrine's documentation it requires php version 5.2.3 or greater. i've checked my current version in mamp with phpinfo(), it says i've got version 5.2.11. how can i get mamp to work with doctrine? i have never upgraded php engine manually. thanks! ...

proper way of setting an attribute in Doctrine?

in some tutorials they tell you to set up an attribute like this: $manager = Doctrine_Manager::getInstance(); Doctrine_Manager::getInstance()->setAttribute( Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true); and in the documentation it shows you this: $manager = Doctrine_Manager::getInstance(); $manager->setAttribute( Doctrine::AT...

best way to create tables with ORM?

assume that i start coding an application from scratch, is the best way to create tables when using an ORM (doctrine), to manually create tables in mysql and then generate models from the tables, or is it the other way around, that is to create the models in php and then generate tables from models? and if i already have a database, wil...

understanding the arguments passed to hasColumn() in Doctrine

Im using Doctrine and i dont quite understand this code here: $this->hasColumn('id', 'integer', 8, array( 'type' => 'integer', 'length' => 8, 'fixed' => false, )); what is the 2nd and 3rd argument in hasColumn for? the 2nd is the type and the 3rd the length? if so, why do we specify them again in th...

Doctrine YAML not generating correctly? Or is this markup wrong?

I'm trying to get a many-to-many relationship between Users and Settings. The models seem to be generated correctly, however the following query fails: "User_Setting" with an alias of "us" in your query does not reference the parent component it is related to. $q = new Doctrine_RawSql(); $q->select('{s.*}, {us.*}') ->from('U...

Can Doctrine INDEXBY be used in the RawSql function? If so, where to place?

Is it possible to have the Doctrine Collection INDEXBY feature used in RawSql? If so, how? I'd like to index the collection returned by the following query on s.constant_name. $q = new Doctrine_RawSql(); $q->select('{s.*}, {us.*}') ->from('User u CROSS JOIN Setting s LEFT JOIN User_Setting us ON us....

retrieving object information with Doctrine

i want to fetch information from the database using objects. i really like this approach cause this is more OOP: $user = Doctrine_Core::getTable('User')->find(1); echo $user->Email['address']; echo $user->Phonenumbers[0]->phonenumber; rather than: $q = Doctrine_Query::create() ->from('User u') ->leftJoin('u.Email e') ->l...

Doctrine: Unable to execute either CROSS JOIN or SELECT FROM Table1, Table2?

Using Doctrine I'm trying to execute either a 1. CROSS JOIN statement or 2. a SELECT FROM Table1, Table2 statement. Both seem to fail. The CROSS JOIN does execute, however the results are just wrong comparing to execution in Navicat. The multiple table SELECT doesn't even execute because Doctrine automatically tries to LEFT JOIN the ...

doctrine reference?

i've found one cheat sheet for doctrine: cheat sheet but it doesn't list all methods for Doctrine_Record, Doctrine_Core, Doctrine_Query etc. i wonder if there is a such reference? Would be very helpful. ...

what is doctrine hydration?

i've read about hydration in doctrine's documentation but i still cant understand what it is. could someone please explain? ...

using string, blob or clob for thread body in doctrine?

what data type (string, blob or clob) should i use for my thread body when using doctrine? and what length should it be? i have read the documentation but dont quite understand the differences between them. seems that all three can store unlimited nr of characters. could someone explain and how do i store unlimited characters in str...

graphical relationship map for doctrine/mysql?

i wonder if there is gui tools for creating a graphical map for the relationship between models/objects (doctrine) or tables (mysql)? it would be better than draw it manually. i´ve already have the models/objects and tables created. ...

Doctrine_Query update with float value

I need to increment User's balance, so I do: Doctrine_Query::create()->from('User')->update('balance', 'balance + 0.15')->execute(); And I got an error "Unknown component alias 0". I think its because of 0.15 So how can I update (using DQL) balance without additional SELECT queries to User's table to fetch his balance, calculate new b...

help with generating models from database for many to many in doctrine

im using doctrine and i have set up some test tables to be generated into models: I want a many-to-many relationship models (3 tables converted into 3 models) (things are simplified to make the point clear) mysql tables: user: id INT // primary key name VARCHAR group: id INT // primary key name VARCHAR user_group: user_id INT // pr...

Doctrine 2 is stable enough to use for a production project?

i wonder if Doctrine 2 is stable enough to use for a production project? i guess the project will be finished 3 months from now so maybe then Doctrine 2 will be released in a complete version. i'm wondering if its smarter to use learn and use doctrine 2 right away instead of learning the current version and then convert everything to v...