1
votes

I'm migrating my project made from symfony 1.4.15 with doctrine (1.2 i guess) using PHP<5 to PHP7 and i have big problems:

When i'm doing :

->select('k.*,v.*,t.*')
->from('DataKey k')
->leftJoin('k.Values v')

with config :

DataKey:
   columns:
     type:                { type: string(5), notnull: true, comment: 'Type de donnée (list/int/text/float)' }
     description:         { type: string(255), notnull: true, comment: 'Libelle' }
     unit:                { type: string(10), notnull: false, comment: 'Unité de valeur' }

DataValue:
  columns:
     key_id:              { type: integer, notnull: true, comment: 'Identifiant de donnée' }
     value_id:            { type: string(10), notnull: true, comment: 'Identifiant de valeur' }
     description:         { type: string(255), notnull: true, comment: 'Libelle' }
  relations:
     DataKey:            { class: DataKey, local: key_id, foreign: id }

i got this error :

/doctrine/Doctrine/Relation.php on line 451 PHP message: PHP Notice:
Array to string conversion in /lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Relation.php on line 451

PHP message: Unknown record property / related component "

alias : DataKey
foreign : id
local : key_id
class : DataKey
type : 0
table : Object(DataKeyTable)
localTable : Object(DataValueTable)
name : 
refTable : 
onDelete : 
onUpdate : 
deferred : 
deferrable : 
constraint : 
equal : 
cascade : Array
owningSide : 
refClassRelationAlias : 
foreignKeyName : 
orderBy : 
" on "DataValue"

Any ideas?

1
migrate to PHP7 is great, but i think you should have migrat to symfony 3 before, or at least symfony2.t-n-y
i'm agree, i would so. But i had no time for rewrite the whole app. i'm working from existing app coded by others.Sticky
It was a good idea to test on PHP7, but if you have an error in the vendor if will be a pain to fix now, or will have to fix the code by yourself. You should try a progressive migration of the app to Symfony3. Keeping both old PHP5 and new PHP7 servers.COil
I can't migrate to symfony 3 i have no more time. I mean, i'm not the sys admin and not the boss of the project : my job is to put the project on server and make it run. I have 3 project symfony 1.4.20 using propel not doctrine with no problems...Sticky

1 Answers

0
votes

There is a little problem with new PHP syntax.

Doctrine/Collection.php

- $record->$relation['alias'] = $this->reference;
+ $record->{$relation['alias']} = $this->reference;

Doctrine/Query/Abstract.php

- $record->$callback['callback']($event);
- $table->getRecordListener()->$callback['callback']($event);
+ $record->{$callback['callback']}($event);
+ $table->getRecordListener()->{$callback['callback']}($event);

Details on the GitHub