public function find($id = null)
    {
        // ID has to be defined
        if (!isset($id)) {
            throw new \InvalidArgumentException('Undefined ID to find', 400);
        }

        // Return the first found record using the primary key for the where
        $result = $this->where($this->primaryKey, $id, '=', $this->table)->limit(1)->first();

        // Return the first matching record
        return $result;
    }
public function find($id = null)
    {
        // ID has to be defined
        if (!isset($id)) {
            throw new \InvalidArgumentException('Undefined ID to find', 400);
        }

        // Return the first found record using the primary key for the where
        $result = $this->where($this->primaryKey, $id, '=', $this->table)->limit(1)->first();

        // Return the first matching record
        return $result;
    }
public function find ( $ id = null ) { // ID has to be defined if ( ! isset ( $ id ) ) { throw new \ InvalidArgumentException ( 'Undefined ID to find' , 400 ) ; } // Return the first found record using the primary key for the where $ result = $ this -> where ( $ this -> primaryKey , $ id , '=' , $ this -> table ) -> limit ( 1 ) -> first ( ) ; // Return the first matching record return $ result ; }
Returns a single model by primary key

@param string $id Primary key value
@return bool|array Model attributes, or false
Returns a single model by primary key