public function exists($id)
    {
        $result = $this->select()->where($this->getPrimaryKeyPredicate($id))
                        ->columns(['count' => new Expression('count(*)')])
                        ->execute()
                        ->toArray();

        return ($result[0]['count'] > 0);
    }
public function exists($id)
    {
        $result = $this->select()->where($this->getPrimaryKeyPredicate($id))
                        ->columns(['count' => new Expression('count(*)')])
                        ->execute()
                        ->toArray();

        return ($result[0]['count'] > 0);
    }
public function exists ( $ id ) { $ result = $ this -> select ( ) -> where ( $ this -> getPrimaryKeyPredicate ( $ id ) ) -> columns ( [ 'count' => new Expression ( 'count(*)' ) ] ) -> execute ( ) -> toArray ( ) ; return ( $ result [ 0 ] [ 'count' ] > 0 ) ; }
Test if a record exists

@param integer|string|array $id

@throws Exception\InvalidArgumentException when the id is invalid
@throws Exception\PrimaryKeyNotFoundException

@return boolean
Test if a record exists