64 lines
1.1 KiB
PHP
64 lines
1.1 KiB
PHP
<?php
|
|
|
|
|
|
namespace Bx\Null\Factory;
|
|
|
|
|
|
use Bx\Null\Collection\NullCollection;
|
|
use Bx\Null\Entity\NullEntity;
|
|
use Bx\Null\ORM\NullTable;
|
|
use Wt\Core\Factory\AFactory;
|
|
use Wt\Core\Factory\AORMFactory;
|
|
|
|
class NullFactory extends AORMFactory
|
|
{
|
|
|
|
/**
|
|
* @return string|NullTable
|
|
*/
|
|
protected function __getDataManagerClass()
|
|
{
|
|
return NullTable::class;
|
|
}
|
|
|
|
public function __getEntityClass()
|
|
{
|
|
return NullEntity::class;
|
|
}
|
|
|
|
public function __getCachePrefix()
|
|
{
|
|
return 'bx_null';
|
|
}
|
|
|
|
/**
|
|
* @param $id
|
|
* @return NullEntity
|
|
*/
|
|
public function getEntityById($id)
|
|
{
|
|
|
|
$res = $this->getList(['=ID' => $id]);
|
|
if( $res ){
|
|
return $this->getEntityByResult(reset($res));
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* @param array $arIds
|
|
* @return NullCollection
|
|
*/
|
|
public function getEntityByIds(array $arIds)
|
|
{
|
|
return parent::getEntityByIds($arIds); // TODO: Change the autogenerated stub
|
|
}
|
|
|
|
/**
|
|
* @return NullTable
|
|
*/
|
|
public function getDataManager()
|
|
{
|
|
return parent::getDataManager();
|
|
}
|
|
} |