Model.class.php
public static function find( $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 array();

		/* Generate array of entities for return */
		$entities = array();
		foreach ( $collection as $row ) {

			/* Create entity */
			$modelClass = get_called_class();
			$entity = new $modelClass($row->id);

			$entities[] = $entity;

		}

		if ( !count( $entities ) ) return array();

		return $entities;

	}
public static function find( $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 array();

		/* Generate array of entities for return */
		$entities = array();
		foreach ( $collection as $row ) {

			/* Create entity */
			$modelClass = get_called_class();
			$entity = new $modelClass($row->id);

			$entities[] = $entity;

		}

		if ( !count( $entities ) ) return array();

		return $entities;

	}
public static function find ( $ 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 array ( ) ; /* Generate array of entities for return */ $ entities = array ( ) ; foreach ( $ collection as $ row ) { /* Create entity */ $ modelClass = get_called_class ( ) ; $ entity = new $ modelClass ( $ row -> id ) ; $ entities [ ] = $ entity ; } if ( ! count ( $ entities ) ) return array ( ) ; return $ entities ; }
Fetch collection of entities
@param string|array $options
Fetch collection of entities