예제 #1
0
파일: Base.php 프로젝트: railsphp/framework
 protected static function initAttributeSet()
 {
     $className = get_called_class();
     if (!Attributes::attributesSetFor($className)) {
         Attributes::setClassAttributes($className, static::attributeSet());
     }
 }
예제 #2
0
 /**
  * @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());
     }
 }