/** * @param int $item_id * @param int|null $node_id - укаывается для кеширования. * * @return mixed|\SmartCore\Module\Texter\Entity\Item */ public function get($item_id, $node_id = null) { $cache_key = 'smart_module.texter' . $item_id; if (false == ($item = $this->cache->get($cache_key))) { $item = $this->em->find('TexterModule:Item', $item_id); if ($node_id) { $this->cache->set($cache_key, $item, ['smart_module.texter', 'node_' . $node_id]); } } return $item; }
public function __construct($NameSpace, $Options) { parent::__construct($NameSpace, $Options); $this->Memcache = new \Memcache(); foreach ($Options['servers'] as $Server) { list($Host, $Port, $Weight) = explode(":", $Server); $this->Memcache->addServer($Host, $Port, true, $Weight); } }
public function __construct($NameSpace, $Options) { parent::__construct($NameSpace, $Options); }
public function __construct($NameSpace, $Options) { parent::__construct($NameSpace, $Options); $this->InitDBFile(); }
public function __construct($NameSpace, $Options) { parent::__construct($NameSpace, $Options); $this->CacheBaseDir = $Options['cache_dir']; }