protected static function initAttributeSet() { $className = get_called_class(); if (!Attributes::attributesSetFor($className)) { Attributes::setClassAttributes($className, static::attributeSet()); } }
/** * @see initAttrsDirtyModel() * @see getAttributesClass() */ protected function initializeAttributes(array $attributes) { $className = get_called_class(); /** * Check if attributes are set for this class. Set them if not. */ if (!Attributes::attributesSetFor($className)) { $className::initAttributeSet(); } $attrsClass = $this->getAttributesClass(); $this->attributes = new $attrsClass($className, $this->defaultAttributes()); if ($attributes) { $this->setAndFilterProperties($attributes); $this->getAttributes()->set($attributes, null, $this->initAttrsDirtyModel()); } }