/** * @param IDependencyProvider $provider * @param Selection $selection * @return static */ public static function create(IDependencyProvider $provider, $selection) { /** @var $collection StoredCollection */ $collection = parent::newInstance($provider); if ($selection !== false && $selection !== null && $selection instanceof Selection) { $collection->setSelection($selection); } return $collection; }
/** * @param IDependencyProvider $provider * @param ActiveRow|boolean|null $row * @return static */ public static function create(IDependencyProvider $provider, $row = null) { /** @var $entity StoredEntity */ $entity = parent::newInstance($provider); if ($row !== false && $row !== null && $row instanceof ActiveRow) { $entity->setRecord($row); } return $entity; }