コード例 #1
0
ファイル: ActiveModel.php プロジェクト: phpffcms/ffcms-core
 /**
  * Special function for locale stored attributes under serialization.
  * @param string $attribute
  * @return array|null|string
  */
 public function getLocaled($attribute)
 {
     // if always decoded
     if (Obj::isArray($this->{$attribute})) {
         return $this->{$attribute}[App::$Request->getLanguage()];
     }
     if (!Obj::isString($attribute) || Str::likeEmpty($this->{$attribute})) {
         return null;
     }
     return Serialize::getDecodeLocale($this->{$attribute});
 }