Questions tagged [doctrine-1.2]

Doctrine 1.2 is a PHP (5.2.3+) ORM. While Doctrine 2.0 uses the Data Mapper pattern, Doctrine 1.2 uses the Active Record pattern.

Doctrine 1.2 is a PHP (PHP 5.2.3+) ORM. While Doctrine 2.0 uses the Data Mapper pattern, Doctrine 2.0 uses the Active Record pattern. The Doctrine project is a collection open source libraries and tools for dealing with database abstraction and Object-Relational Mapping written in PHP.

Useful links

388 questions
7
votes
4 answers

Adding virtual columns to current table in Doctrine?

I'm using Doctrine 1.2 with Symfony 1.4. Let's say I have a User model, which has one Profile. These are defined as: User: id username password created_at updated_at Profile: id user_id first_name last_name address city postal_code I would…
Matt Huggins
  • 81,398
  • 36
  • 149
  • 218
7
votes
4 answers

doctrine findby magic null value

I'm wondering if there is anyway to use doctrine's magic method to look for null values. For instance: Doctrine::getTable('myClass')->findByDeletedAt(null); Essentially, I want to return all records that are not deleted. I've tried the above, but…
Sean
  • 91
  • 1
  • 1
  • 3
7
votes
3 answers

How to get result information when updating mysql table with Doctrine ORM in symfony 1.4

I am developing with symfony 1.4 and using Doctrine ORM. After building schema and models i've got some classes for work with database. I can also use Doctrine_query .... The only thing, that i cann`t understend is: I need to update…
6
votes
2 answers

Setting up Doctrine_Collection key mapping attribute in schema.yml

In Doctrine 1.2, it is possible to set up Key Mapping for a table where Doctrine_Collection objects created by that table will populate keys from a particular column in each record in the collection. An example from the documentation linked…
user212218
6
votes
2 answers

Why does doctrine use WHERE IN instead of LIMIT?

Why does doctrine (1.2) use WHERE IN instead of LIMIT? This code: Doctrine_Query::create() ->from('Table t') ->limit(10) ->getSqlQuery(); Returns something like this: SELECT t.id_table AS t__id_table FROM table AS t WHERE t__id_table IN…
Petr Peller
  • 8,581
  • 10
  • 49
  • 66
6
votes
3 answers

How to control which connection is selected from the database.yml in a symfony1.4 task

(See my edit below for a better question) How do I control which connection is selected (from the right environment section in the database.yml) in a symfony1.4 task using just a generic Doctrine_Query::create() to create the query? I'm using a…
Tommy Bravo
  • 532
  • 8
  • 29
6
votes
4 answers

What are the options available for Doctrine's Doctrine_Core::generateModelsFromDb method?

Doctrine 1.2 has a method called generateModelFromDb, documented here, that generates model files for all of the tables in a database. This function accepts an optional third parameter with an array of "options" to use when generating models, the…
Tobias Cohen
  • 19,893
  • 7
  • 54
  • 51
5
votes
3 answers

How to delete all data without breaking referential integrity using Doctrine?

I've put together a unit testing plugin for Symfony 1.4 that attempts to manage the database automatically, similarly to the way Django's test framework does it (destroy and rebuild the database between tests). It makes sense to destroy and rebuild…
user212218
5
votes
1 answer

doctrine relation on integer field returns string

My schema.yml Organisation: columns: id: { type: integer(4), notnull: true, unique: true, primary: true, autoincrement: true } name: { type: string(100), notnull: true, unique: true } parent_organisation_id: { type: integer(4),…
jdog
  • 2,465
  • 6
  • 40
  • 74
5
votes
2 answers

Determining which field causes Doctrine to re-query the database

I'm using Doctrine with Symfony in a couple of web app projects. I've optimised many of the queries in these projects to select just the fields needed from the database. But over time new features have been added and - in a couple of cases -…
Ian Gregory
  • 5,770
  • 1
  • 29
  • 42
5
votes
1 answer

symfony: actAs: { Timestampable: ~ }

I've got two little questions: actAs: { Timestampable: ~ } What the "~" what mean in the code above? Then, I've seen that tables with actAs: { Timestampable: ~ } have two fields (created_at and updated_at). Is it possible to bind the updated_at…
satboy78
  • 217
  • 1
  • 5
  • 14
4
votes
1 answer

Doctrine DQL: condition on left join

I have a one to many schema: Desk has many Bills. Is it possible to fetch all Desk records with some Bill records. I am trying to do this: //DeskTable.class.php public function getDesks() { $q = $this->createQuery('d') ->leftJoin('d.Bills…
Dziamid
  • 11,225
  • 12
  • 69
  • 104
4
votes
2 answers

Doctrine 1.2: Disabling caching

Similarly to this question, I got some problems with how doctrine caches/hydrates the relations of the result of my query. Now I know I can fix the issue by calling refresh/refreshRelated, but is there a way to disable the hydration cache for a…
Peter
  • 41
  • 1
  • 2
4
votes
1 answer

Driver not found when calling "doctrine create-db"

I didn't know why but, I'm not able to perform this command with doctrine create-db . As you can see, my pdo and pdo_mysql is activated. php -i | grep 'ini' Configuration File (php.ini) Path => /etc/php5/cli Loaded Configuration File =>…
Jean-Francois
  • 1,899
  • 4
  • 35
  • 73
4
votes
1 answer

Doctrine: Order by alias with same name as column

I have following DQL (Doctrine1.2): $dql->select('sum(t.column1) column1, t.column2') ->from('Table t') ->groupBy('t.column2') ->orderBy('column1'); But the generated SQL is same like for the following DQL: $dql->select('sum(t.column1)…
Petr Peller
  • 8,581
  • 10
  • 49
  • 66
1
2
3
25 26