eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway::countInstancesOfType PHP Method

countInstancesOfType() abstract public method

Counts the number of instances that exists of the identified type.
abstract public countInstancesOfType ( integer $typeId ) : integer
$typeId integer
return integer
    public abstract function countInstancesOfType($typeId);

Usage Example

 /**
  * Counts the number of instances that exists of the identified type.
  *
  * @param int $typeId
  *
  * @return int
  */
 public function countInstancesOfType($typeId)
 {
     try {
         return $this->innerGateway->countInstancesOfType($typeId);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }
All Usage Examples Of eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway::countInstancesOfType