Open stvowi opened 7 years ago
The Globiterator issue was fixed in 5.6, so this suggests your installation isn't up to date (current version is 5.6.30).
I thought, Fuel PHP needs only PHP 5.3.0 .
Okay, than we come to the next problem.
There will generated 2 id fields in the model if the database table have the id field.
Sample:
<?php
use Orm\Model;
class Model_Object extends Model
{
protected static $_properties = array(
'id',
'id',
'label',
'created_at',
'updated_at',
);
protected static $_observers = array(
'Orm\Observer_CreatedAt' => array(
'events' => array('before_insert'),
'mysql_timestamp' => false,
),
'Orm\Observer_UpdatedAt' => array(
'events' => array('before_save'),
'mysql_timestamp' => false,
),
);
public static function validate($factory)
{
$val = Validation::forge($factory);
$val->add_field('id', 'Id', 'required|valid_string[numeric]');
$val->add_field('label', 'Label', 'required|max_length[500]');
return $val;
}
}
BTW, why will generated the observer, if I don't have created_at/ updated_at fields not in the database table?
PHP 5.3.3+ to be exact. But that doesn't mean it contains workarounds for PHP bugs for any released version after that.
I'll have a look at where the double "id" fields comes from. Just to check, your table only contains an 'id' field (as int, PK) and a label field (char of some sort)?
...don't work. I tested with WAMP server and PHP 5.6 and Fuel 1.9 dev
I got an exception in scaffold.php Line 63: array to string conversersion.
I fixed it with...
and than I got a new exception in generate.php (line 2040)....GlobIterator throws LogicException There is a Problem with the GlobIterator. (see: https://bugs.php.net/bug.php?id=55701)