/** * */ 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; }
public function __construct(array $attributes = array(), $propertyTitle = null) { $this->propertyTitle = $propertyTitle; parent::__construct($attributes); }