/** * Initialise data for configuration * @return void */ protected function initData() { $data = $this->cache->load($this->cacheId); if (false === $data) { $data = $this->reader->read(); $this->cache->save(serialize($data), $this->cacheId, $this->cacheTags); } else { $data = unserialize($data); } $this->merge($data); }
/** * Create autodisovery structure * Param use $string "%s_id" to access $name . "_id" column in $row->$name * @param \PDO $connection * @param CacheInterface $cache * @param string $foreign */ public function __construct(\PDO $connection, CacheInterface $cache = null, $foreign = '%s') { $this->connection = $connection; $this->cache = $cache; $this->foreign = $foreign; if ($cache) { $this->structure = $cache->load("structure"); } }