Model.class.php
public function count( $where = 'all', $options = array() )
	{

		$dbr = wfGetDB( DB_SLAVE );

		if ( !is_array( $where ) && $where == 'all' ) {

			/* Fetch all entities */
			$collection = $dbr->select( static::$table,
				'id',
				array(),
				__METHOD__,
				$options
			);

		} else {

			/* Fetch conditional entities */
			$collection = $dbr->select( static::$table,
				'id',
				$where,
				__METHOD__,
				$options
			);

		}

		/* Check result */
		if ( !$collection ) return 0;

		$count = $dbr->numRows( $collection );

		return $count;

	}
public function count( $where = 'all', $options = array() )
	{

		$dbr = wfGetDB( DB_SLAVE );

		if ( !is_array( $where ) && $where == 'all' ) {

			/* Fetch all entities */
			$collection = $dbr->select( static::$table,
				'id',
				array(),
				__METHOD__,
				$options
			);

		} else {

			/* Fetch conditional entities */
			$collection = $dbr->select( static::$table,
				'id',
				$where,
				__METHOD__,
				$options
			);

		}

		/* Check result */
		if ( !$collection ) return 0;

		$count = $dbr->numRows( $collection );

		return $count;

	}
public function count ( $ where = 'all' , $ options = array ( ) ) { $ dbr = wfGetDB ( DB_SLAVE ) ; if ( ! is_array ( $ where ) && $ where == 'all' ) { /* Fetch all entities */ $ collection = $ dbr -> select ( static :: $ table , 'id' , array ( ) , __METHOD__ , $ options ) ; } else { /* Fetch conditional entities */ $ collection = $ dbr -> select ( static :: $ table , 'id' , $ where , __METHOD__ , $ options ) ; } /* Check result */ if ( ! $ collection ) return 0 ; $ count = $ dbr -> numRows ( $ collection ) ; return $ count ; }
Count entities. There some code that should be fixed.
@param string $where
@param array $options
@return int
Count entities . There some code that should be fixed .