public function findOneByKey($key, $value)
    {
        try {
            $model = $this->findOneByKeyFromCache($key, $value);
        } catch (\Tx_Oelib_Exception_NotFound $exception) {
            $model = $this->findSingleByWhereClause([$key => $value]);
        }

        return $model;
    }
public function findOneByKey($key, $value)
    {
        try {
            $model = $this->findOneByKeyFromCache($key, $value);
        } catch (\Tx_Oelib_Exception_NotFound $exception) {
            $model = $this->findSingleByWhereClause([$key => $value]);
        }

        return $model;
    }
public function findOneByKey ( $ key , $ value ) { try { $ model = $ this -> findOneByKeyFromCache ( $ key , $ value ) ; } catch ( \ Tx_Oelib_Exception_NotFound $ exception ) { $ model = $ this -> findSingleByWhereClause ( [ $ key => $ value ] ) ; } return $ model ; }
Looks up a model by key.

This function will first check the cache-by-key and, if there is no match,
will try to find the model in the database.

@throws \Tx_Oelib_Exception_NotFound if there is no match (neither in the
cache nor in the database)

@param string $key an existing key, must not be empty
@param string $value
the value for the key of the model to find, must not be empty

@return \Tx_Oelib_Model the cached model
Looks up a model by key .