src/models/Property.php
public static function getValues($name, $index = 'code') {
		if($property_id = self::getId($name)) {
			$a = [];
			foreach(Lookup::find()
				->select(['position', 'name'])
				->where(['property_id' => $property_id])
				->orderBy($index)->all() as $item)
				$a[$item->$index] = $item->name;
			return $a;
		} else
			return null;
	}
public static function getValues($name, $index = 'code') {
		if($property_id = self::getId($name)) {
			$a = [];
			foreach(Lookup::find()
				->select(['position', 'name'])
				->where(['property_id' => $property_id])
				->orderBy($index)->all() as $item)
				$a[$item->$index] = $item->name;
			return $a;
		} else
			return null;
	}
public static function getValues ( $ name , $ index = 'code' ) { if ( $ property_id = self :: getId ( $ name ) ) { $ a = [ ] ; foreach ( Lookup :: find ( ) -> select ( [ 'position' , 'name' ] ) -> where ( [ 'property_id' => $ property_id ] ) -> orderBy ( $ index ) -> all ( ) as $ item ) $ a [ $ item -> $ index ] = $ item -> name ; return $ a ; } else return null ; }
Get all property values as array with Code or Position as index.
@params string property name
@params string code or position
@return array
Get all property values as array with Code or Position as index .