doctrine

Doctrine ORM - Implement self-relations

Hi everyone! Can anyone give me an example of how to implement a class self-relation? Thanks in advance, Best regards! ...

Symfony : How to use widgets with i18n forms in backend (doctrine)

Hi everybody. I can not manage to have both i18n and tinyMCE widgets on internationalised fields. If i put both, i will have internationalised fields for all my objects' fields, but no tinyMCE for them. I will have as much tinyMCE fields as i declared, but thew will not correspond to any language, they will be at the beginning or at the...

Doctrine Load Module Exception

Hello all, I'm new to doctrine. I created an bootstrap file like the following one: require_once(dirname(__FILE__)."/../conf/general.php"); require_once(dirname(__FILE__).'/Doctrine/lib/Doctrine.php'); spl_autoload_register(array('Doctrine', 'autoload')); $manager = Doctrine_Manager::getInstance(); $manager->setAttribute(Doctrine::AT...

Doctrine ORM JOINS

I have a few simple classes, all extending Doctrine_Record. Now I want to make a slightly more complex query with Inner Join, not just table data extracting. I am doing to use DQL, does this oblige me to manually define relation between 2 tables? Should I define this relation class or I better update schema.yml and somehow re-generate...

Doctrine - schema.yml error

Hi there! I have the following schema.yml file: Page: actAs: I18n: fields: [name,html,urlShortDesc] columns: name: string gender: type: enum values: [html, photoGallery] default: html html: string urlShortDesc: string section_id: type: integer notnull: true relations: ...

Switch symfony 1.4 from doctrene to propel

How can I properly switch the newly installed Symfony 1.4 framework from Doctrine (that it is configured for by default) to Propel? ...

Getting Doctrine to use MySQL "FORCE INDEX"

I have a query in Doctrine's DQL that needs to be able to use MySQL's "FORCE INDEX" functionality in order to massively reduce the query time. Below is what the query basically looks like in plain SQL: SELECT id FROM items FORCE INDEX (best_selling_idx) WHERE price = ... (etc) LIMIT 200; I assume I have to extend some Doctrine compon...

Extra changeColumns in Doctrine generate-migrations-diff

I'm generating migrations between different yaml schema files: i.e. running: symfony doctrine:generate-migrations-diff And the resulting migration file has a whole slew of changeColumn calls that weren't added in the last schema file change. For example, if you run generate-migrations-diff without changing your schema file whatsoever,...

Why can't I create a Doctrine model named 'Album'

I'm using Doctrine as ORM in my project but ran against a strange error: Using following YAML: Album: tableName: dpp_album actAs: [Timestampable] columns: name: string(255) description: string(255) online: boolean I then generate my models but upon refreshing my page and autoloading the models, PHP serves this error...

Standard idiom for adding new models to an app built on Symfony + Doctrine

What is the a standard way of adding new model to my app built on Symfony + Doctrine while maintaining all previous models and their meta-data (like relationships). What am I really looking for: A command / procedure that will be equivalent of ./script/generate model FooModel in Ruby on Rails (which does not have any sort of reset db / ...

many-to-many relationship in doctrine

I've got some tables on my system like these: news --id --title --content video --id --title --url album --id --title Now, I need to do a many-to-many relatioship with this tables, but in a flexible way. I created a table called 'links' with the below structure: links --parent_entity (example: news) --parent_id (example: 5) --chi...

Doctrine - subquery in from

I have query in mysql: SELECT * FROM ( SELECT COUNT(*) AS count, t.name AS name FROM tag t INNER JOIN video_has_tag v USING (idTag) GROUP BY v.idTag ORDER BY count DESC LIMIT 10 ) as tags ORDER BY name and I want to write this in doctrine. How I can do that? I wrote: Doctrine_Query::create() ->select('...

Zend Framework, Doctrine Help needed

i am following the tutorial from http://www.zendcasts.com/introducing-doctrine-1-2-integration/2009/11/ i have a doctrine.php that "bootstraps?" doctrine ... sry i dont really fully understand the tut yet // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . ...

How to generate Doctrine models/classes that extend a custom record class

When I use Doctrine to generate classes from Yaml/db each Base class (which includes the table definition) extends the Doctrine_Record class. Since my app uses a master and (multiple) slave db servers I need to be able to make the Base classes extend my custom record class to force writes to go to the master db server (as described here...

Couldn't locate driver named mysql in doctrine php....

My application was working perfectly on localhost. But when i uploaded the application on server i got an error. I made a test file to check databse connection, this is the error i am getting. Please hellp me how to fix this.. Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't locate driver named mys...

doctrine path setting.

My mysql connection setting: <?php mysql_connect("fanyer.fatcowmysql.com", "test_username", "test_password") or die(mysql_error()); echo "Connected to MySQL<br />"; mysql_select_db("fanyer_database") or die(mysql_error()); echo "Connected to Database"; ?> This is working perfectly.. Now i am using this in doctrine bootstra...

Doctrine YAML Data Fixture Question

where can i learn more abt creating database markup in yaml and data fixtures. i followed a tutorial and they create a relationship like so: under relations in both User and Car. my qn is why is 'type: many' in Car. can i have it in User instead (just curious)? abt data types. different database have different database support. i thou...

Why do i get a Circular Dependency Exception with these Zend_Application_Resources?

I keep getting the following exception with a new resource Im making and i cant figure out why: PHP Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Circular resource dependency detected' in /opt/local/lib/php/Zend/Application/Bootstrap/BootstrapAbstract.php:656 Stack trace: #0 /opt/local/lib/php/Zen...

Doctrine Connection export() and export option in yml

i got a (or rather 2) small question(s) from doctrine manual $conn->export->createTable('test', array('name' => array('type' => 'string'))); $conn->execute('INSERT INTO test (name) VALUES (?)', array('jwage')); whats the $conn->export() abt. i mean, the export(). whats it for? has it got any thing to do with the export option in the...

Doctrine - Retrieving list of fields in subclass gets all fields in aggregate

I have an object model that contains a class with several subclasses. The subclasses share a few fields from the parent, but they each have their own fields as well. I'm using the column_aggregation inheritance type to do this because I want to be able to polymorphically store objects of the parent class type, but retrieve objects ...