Пример #1
0
		public function __get($var)
		{
			if( $var == 'ingredients' )
			{
				return Ingredient::getByItem($this->itemid);
			}
			elseif( $var == 'recommendations' )
			{
				return Ingredient::getRecommendedByItem($this->itemid);
			}
			elseif( $var == 'characteristics' )
			{
				return Characteristic::getByItem($this->itemid);
			}
			elseif( $var == 'category' )
			{
				return Category::getByID($this->categoryid);
			}
			elseif( $var == 'price' )
			{
				return money_format('%i', $this->price);
			}
			else
			{
				return $this->$var;
			}
		}