As ext-js do with Ext.CompositeElementLite,
It maybe would be a good idea to modify multiple objects as if they were one !
I have to work on that...
mercredi 17 juin 2009
Propel Collection Object
AS you can see here, BaseObjects collection could be a very usefull functionnality for Propel ( or others ).
Propel dev's are apparently discussing on that, but it will not be implemented before 2.0.
Thats sounds good, so when 2.0 will be out ?!
Propel dev's are apparently discussing on that, but it will not be implemented before 2.0.
Thats sounds good, so when 2.0 will be out ?!
magic method call for Propel Peer class
It's just an idea, I didn't tested already !!
Not my fault, PHP 5.3 isn't in ubuntu default repositories... ;)
Not my fault, PHP 5.3 isn't in ubuntu default repositories... ;)
public function __call($name, $args) {
return self::handleCall($name, $args);
}
// As of PHP 5.3
public static function __callStatic($name, $args) {
return self::handleCall($name, $args);
}
private static function handleCall($name, $args) {
if(strstr('doSelectOrderedBy', $name) !== false) {
return self::handleDoSelectOrderedBy($name, $args);
}
throw new Exception('Invalid call : the method ['.$name.'] is not defined in class ['.get_class($this).'].');
}
/**
* Called by magic method __callStatic for adding Ascending or Descending order to Criteria;
*
* Catch method names with pattern : doSelectOderedBy*Asc OR doSelectOderedBy*Desc
* where * is the PHPName of a column.
*
* @param $name The name of method called
*
* @see self::doSelect
* @see Criteria::addAscendingOrderByColumn
* @see Criteria::addDescendingOrderByColumn
*
* @TODO use preg_match ?
* @TODO handle Join with pattern doSelect(Join*)OrderedBy(*)([Asc|Desc])
*
* @return array
*/
private static function handleDoSelectOrderedBy($name, $args) {
$cols = self::fieldKeys;
if(array_key_exists($name, $cols[BasePeer::TYPE_PHPNAME])) {
$c = new Criteria;
$col = substr($name, 17);
$order = substr($col, -4, 4);
$method = sprintf('add%sOrderByColumn', 0 === strpos(strtoupper($order), 'DESC') ? 'Descending' : 'Ascending');
$criteria->$method(call_user_func(array(self, 'translateFieldName'), $col, BasePeer::TYPE_PHPNAME, BasePeer::TYPE_COLNAME));
return self::doSelect($c);
}
}
Inscription à :
Articles (Atom)
