src/PeskyCMF/Db/Traits/CacheForDbSelects.php
public function selectOneFromCache($columns, array $conditions, \Closure $configurator = null) {
        if ($this->cachingIsPossible()) {
            /** @var CmfDbTable|CacheForDbSelects $this */
            if (is_numeric($conditions) || is_int($conditions)) {
                $conditions = array(static::getPkColumnName() => $conditions);
            }
            static::addCacheOptionToConditionsAndOptions($conditions, true);
        }
        return $this->selectOne($columns, $conditions, $configurator);
    }
public function selectOneFromCache($columns, array $conditions, \Closure $configurator = null) {
        if ($this->cachingIsPossible()) {
            /** @var CmfDbTable|CacheForDbSelects $this */
            if (is_numeric($conditions) || is_int($conditions)) {
                $conditions = array(static::getPkColumnName() => $conditions);
            }
            static::addCacheOptionToConditionsAndOptions($conditions, true);
        }
        return $this->selectOne($columns, $conditions, $configurator);
    }
public function selectOneFromCache ( $ columns , array $ conditions , \ Closure $ configurator = null ) { if ( $ this -> cachingIsPossible ( ) ) { /** @var CmfDbTable|CacheForDbSelects $this */ if ( is_numeric ( $ conditions ) || is_int ( $ conditions ) ) { $ conditions = array ( static :: getPkColumnName ( ) => $ conditions ) ; } static :: addCacheOptionToConditionsAndOptions ( $ conditions , true ) ; } return $ this -> selectOne ( $ columns , $ conditions , $ configurator ) ; }
Get 1 record from DB
@param string|array $columns
@param null|array|string|int $conditions -
array|string: conditions,
numeric|int: record's pk value, automatically converted to array($this->primaryKey => $where)
@return array
@throws \UnexpectedValueException
@throws \PeskyORM\Exception\OrmException
@throws \InvalidArgumentException
@throws \BadMethodCallException
Get 1 record from DB