public
Created

DynamicCollectionObjectFormatter trait

  • Download Gist
DynamicCollectionObjectFormatter.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13
trait DynamicCollectionObjectFormatterTrait
{
 
public static function create($modelAlias = null, $criteria = null) {
$query = parent::create($modelAlias, $criteria);
 
$formatter = new DynamicCollectionObjectFormatter();
$formatter->setModalName($query->getModelName());
 
return $query->setFormatter($formatter);
}
 
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.