src/Model.php
public function find($id)
    {
        $this->newQuery();

        $this->queryBuilder->whereEqual($this->primaryFieldName, $id);

        $queryKey = $this->queryBuilder->firstQueryKey();

        if (!$this->isCompleteKey($queryKey)) {
            return null;
        }

        list($method, $parameters) = $this->getFindMethodAndParameters();

        array_unshift($parameters, $queryKey);
        $value = call_user_func_array([$this->redClient, $method], $parameters);

        return $value;
    }
public function find($id)
    {
        $this->newQuery();

        $this->queryBuilder->whereEqual($this->primaryFieldName, $id);

        $queryKey = $this->queryBuilder->firstQueryKey();

        if (!$this->isCompleteKey($queryKey)) {
            return null;
        }

        list($method, $parameters) = $this->getFindMethodAndParameters();

        array_unshift($parameters, $queryKey);
        $value = call_user_func_array([$this->redClient, $method], $parameters);

        return $value;
    }
public function find ( $ id ) { $ this -> newQuery ( ) ; $ this -> queryBuilder -> whereEqual ( $ this -> primaryFieldName , $ id ) ; $ queryKey = $ this -> queryBuilder -> firstQueryKey ( ) ; if ( ! $ this -> isCompleteKey ( $ queryKey ) ) { return null ; } list ( $ method , $ parameters ) = $ this -> getFindMethodAndParameters ( ) ; array_unshift ( $ parameters , $ queryKey ) ; $ value = call_user_func_array ( [ $ this -> redClient , $ method ] , $ parameters ) ; return $ value ; }
find an item
@param $id int|string Primary key
@return mixed
find an item