Пример #1
0
 /**
  *
  */
 public static function showPropertyValue($model)
 {
     $properties = self::getPropertyByModel($model);
     $propertyValues = array();
     foreach ($properties as $property) {
         if ($property->type == "date") {
             $res = DateProperty::where('property_id', '=', $property->id)->where('element_id', "=", $model->id)->first();
         } else {
             $res = \App\PropertyValue::where('property_id', '=', $property->id)->where('element_id', "=", $model->id)->first();
         }
         if (!empty($res)) {
             $propertyValues[$property->id] = ['title' => $property->title, 'value' => $res->value, 'code' => $property->code, 'type' => $property->type];
         }
     }
     return $propertyValues;
 }
Пример #2
0
 public function __construct(array $attributes = array(), $propertyTitle = null)
 {
     $this->propertyTitle = $propertyTitle;
     parent::__construct($attributes);
 }