コード例 #1
0
ファイル: MultilingualBehavior.php プロジェクト: DarkAiR/test
 public function canSetProperty($name)
 {
     return parent::canSetProperty($name) or $this->hasLangAttribute($name);
 }
コード例 #2
0
 /**
  * Validate properties that are save in the 'search scenario'.
  * (non-PHPdoc)
  * @see CComponent::canSetProperty()
  */
 public function canSetProperty($key)
 {
     if (parent::canSetProperty($key)) {
         return true;
     }
     if ($this->getOwner()->getScenario() === 'search') {
         return $this->getOwner()->isAttributeSafe($key);
     }
     return false;
 }
コード例 #3
0
 /**
  * Expose translatable attributes as writeable
  */
 public function canSetProperty($name)
 {
     return in_array($name, $this->translationAttributes) || in_array($name, array_keys($this->multilingualRelations)) ? true : parent::canSetProperty($name);
 }
コード例 #4
0
 /**
  * Expose translatable attribues as writeable
  */
 public function canSetProperty($name)
 {
     return in_array($name, $this->translationAttributes) ? true : parent::canSetProperty($name);
 }