public function findIdByExample(OW_Example $example, $cacheLifeTime = 0, $tags = array()) { if ($example === null) { throw new InvalidArgumentException('argument must not be null'); } $example->setLimitClause(0, 1); $sql = 'SELECT `id` FROM ' . $this->getTableName() . $example; return $this->dbo->queryForColumn($sql, array(), $cacheLifeTime, $tags); }
public function test($key) { return $this->dbo->queryForColumn("SELECT `id` FROM `" . $this->getCacheTableName() . "` WHERE `key` = :key AND `expireTimestamp` >= :ts", array('key' => $key, 'ts' => time())) ? true : false; }