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
3
votes
1 answer

Using Doctrine with Domain Driven Design

I'm thinking of implementing a Domain Driven Design approach (similar to the one described here), but want to integrate it with the Doctrine ORM. Has anyone had any success doing anything like this? My initial instinct was to use Doctrine as the DAO…
Bryan M.
  • 17,142
  • 8
  • 46
  • 60
2
votes
1 answer

Doctrine 1.2 Control Flow Function "IF"

Using Doctrine 1.2.4, i cant't resolve using "IF" MySQL instruction under Doctrine. I want generate this SQL code : UPDATE mytable SET mytable.state = IF(mytable.state=0, 128, mytable.state) But using : $stmt_update =…
immobiluser
  • 349
  • 1
  • 2
  • 12
2
votes
1 answer

Order query by input

I do have a query in a table called article. $q = Doctrine_Query::create() ->from('article a') ->WhereIn('a.name', $input) ->execute(); $input = array( 0 => Tomato, 1 => Apple, …
craphunter
  • 961
  • 2
  • 13
  • 34
2
votes
3 answers

Appending a WHERE clause to a Doctrine_Query

I have a situation where I want to assemble a Doctrine select query based on weather certain params are empty or not For example, if there was a $slug variable that was optional, i'd want something like this: function get_bio($slug = '') { $q…
djt
  • 7,297
  • 11
  • 55
  • 102
2
votes
2 answers

How to sort fields of a related (joined) table in query results?

Probably related more to SQL than to Dotrine itself. I have two tables, specified in schema file roughly like this: Project: columns: name: { type: string(255), notnull: true } Task: columns: project_id: { type: integer, notnull: true…
Przemek
  • 6,300
  • 12
  • 44
  • 61
2
votes
2 answers

Doctrine PHP 1.2 - How to skip unique validation of null field

I have a model with unique field, as showed bellow. The problem is the field is optional and when it is null, I get doctrine's unique error message. I was expecting it only to validate uniqueness of 'notnull' => true…
Marcelo
  • 1,702
  • 2
  • 24
  • 42
2
votes
2 answers

Get a list of subclasses of my entity in Doctrine 1.2

Is there a method I can call to obtain the name of all the mapped subclasses of an entity?
Alexander Trauzzi
  • 7,277
  • 13
  • 68
  • 112
2
votes
1 answer

Zend Framework + Doctrine1.2 project structure with more modules

applications coupled with the realization ZendFramework + Doctrine 1.2 for some time, but now they have their first experience with the use of more modules. I requested a default module is visible to everyone with a certain layout and an admin…
JellyBelly
  • 2,451
  • 2
  • 21
  • 41
2
votes
1 answer

how to make Doctrine_Expression ( doctrine 1.2 ) try to get last 7 days

I try to make this query with doctrine 1.2: $q->where('date > ?', new Doctrine_Expression('DATE_SUB(CURDATE() , INTERVAL 7 DAY)')); but it's not return me any results. any idea ? thanks
Haim Evgi
  • 123,187
  • 45
  • 217
  • 223
2
votes
1 answer

How to cascade deletions with Doctrine 1.2?

I have been struggling with defining cascade behavior in Doctrine ORM. According to the documentation, one is supposed to use onDelete: CASCADE for database-level cascade (which is what I am trying to achieve here). A complete example may be seen on…
MattiSG
  • 3,796
  • 1
  • 21
  • 32
2
votes
3 answers

count with doctrine

I have two table: Name id | name | city_id 1 | aaa | 1 2 | vvv | 2 3 | ddd | 2 4 | sss | 3 5 | dds | 1 etc City: id | name 1 | London 2 | NY 3 | Boston etc how can i get City and count: name_city | count London…
Michael Fidy
  • 389
  • 1
  • 4
  • 9
2
votes
2 answers

doctrine how to write WhereIn() with another sql query inside

i have the folowing query in SQL ... where group_id IN (select group_id from alert where monitor_id = 4); I want to write it in Doctrine but i don't know how to add the IN select into WHEREIN() clause ! any idea ? this is what i did $q =…
ProXamer
  • 377
  • 1
  • 9
  • 25
2
votes
1 answer

Using Mysql data type Set with Doctrine 1.2

We're using a database from a legacy system which includes fields with type Set (http://dev.mysql.com/doc/refman/5.0/en/set.html) We need to generate base models constantly from the database. The fields that are type Set in the database are…
adlawson
  • 6,303
  • 1
  • 35
  • 46
2
votes
2 answers

symfony count user

I use symfony 1.4.12 with doctrine. I have sfGuardUser table; I can count all records like this: $count_user=Doctrine::getTable('sfGuardUser')->count(); I have field in table "created_at"; If it possible to count all users, that where created in…
denys281
  • 2,004
  • 2
  • 19
  • 38
2
votes
2 answers

Doctrine 1.2 save Record relations UPDATE rather than INSERT

I am trying to save in cascade some users: $user = new User(); $user->name = 'xxx'; $user->location->id = 1; $user->location->name = 'yyy'; $user->save; $user2 = new User(); $user2->name = 'zzz'; $user2->location->id = 1; …
Fab
  • 96
  • 1
  • 7