Example #1
0
 /**
  * Returns all names of entities of the given peer
  * sorted by name.
  * The array keys are the entity ids,
  * so the array is usable for <select> options.
  */
 public static function getAllNames($peer)
 {
     $c = new Criteria();
     $c->addAscendingOrderByColumn(eval('return ' . $peer . '::NAME;'));
     $collection = new Collection(call_user_func(array($peer, 'doSelect'), $c), 'getName');
     return $collection->getArray();
 }