demos/blog/protected/models/Lookup.php
private static function loadItems($type)
	{
		self::$_items[$type]=array();
		$models=self::model()->findAll(array(
			'condition'=>'type=:type',
			'params'=>array(':type'=>$type),
			'order'=>'position',
		));
		foreach($models as $model)
			self::$_items[$type][$model->code]=$model->name;
	}
private static function loadItems($type)
	{
		self::$_items[$type]=array();
		$models=self::model()->findAll(array(
			'condition'=>'type=:type',
			'params'=>array(':type'=>$type),
			'order'=>'position',
		));
		foreach($models as $model)
			self::$_items[$type][$model->code]=$model->name;
	}
private static function loadItems ( $ type ) { self :: $ _items [ $ type ] = array ( ) ; $ models = self :: model ( ) -> findAll ( array ( 'condition' => 'type=:type' , 'params' => array ( ':type' => $ type ) , 'order' => 'position' , ) ) ; foreach ( $ models as $ model ) self :: $ _items [ $ type ] [ $ model -> code ] = $ model -> name ; }
Loads the lookup items for the specified type from the database.
@param string the item type
Loads the lookup items for the specified type from the database .