コード例 #1
0
ファイル: Numerator.php プロジェクト: novikas/yii2-numerator
 public static function getNumerator($name)
 {
     $template = NumeratorTemplate::findByName($name);
     if (!isset($template)) {
         throw new InvalidArgumentException("Invalid numerator name - \"{$name}\"");
     }
     $masker = new NumeratorMasker(['mask' => $template->mask]);
     return new self(compact('template', 'masker'));
 }
コード例 #2
0
 public function getNumerators()
 {
     return $this->hasMany(NumeratorTemplate::className(), ['FK_type' => 'id']);
 }