kernel/classes/ezpersistentobject.php
public static function count( $def, $conds = null, $field = null )
    {
        if ( !isset( $field ) )
        {
            $field = '*';
        }
        $customFields = array( array( 'operation' => 'COUNT( ' . $field . ' )', 'name' => 'row_count' ) );
        $rows = eZPersistentObject::fetchObjectList( $def, array(), $conds, array(), null, false, false, $customFields );
        return $rows[0]['row_count'];
    }
public static function count( $def, $conds = null, $field = null )
    {
        if ( !isset( $field ) )
        {
            $field = '*';
        }
        $customFields = array( array( 'operation' => 'COUNT( ' . $field . ' )', 'name' => 'row_count' ) );
        $rows = eZPersistentObject::fetchObjectList( $def, array(), $conds, array(), null, false, false, $customFields );
        return $rows[0]['row_count'];
    }
public static function count ( $ def , $ conds = null , $ field = null ) { if ( ! isset ( $ field ) ) { $ field = '*' ; } $ customFields = array ( array ( 'operation' => 'COUNT( ' . $ field . ' )' , 'name' => 'row_count' ) ) ; $ rows = eZPersistentObject :: fetchObjectList ( $ def , array ( ) , $ conds , array ( ) , null , false , false , $ customFields ) ; return $ rows [ 0 ] [ 'row_count' ] ; }
Fetches the number of rows by using the object definition.

Uses fetchObjectList for the actual SQL handling.
See {@link eZPersistentObject::fetchObjectList()} for a full description
of the input parameters.

@param array $def A definition array of all fields, table name and sorting (see {@link eZPersistentObject::definition()} for more info)
@param array|null $conds
@param string|null $field
@return int
Fetches the number of rows by using the object definition .