Dumplie\Metadata\Exception\NotFoundException::model PHP 메소드

model() 공개 정적인 메소드

public static model ( string $name ) : NotFoundException
$name string
리턴 NotFoundException
    public static function model(string $name) : NotFoundException
    {
        return new self(sprintf("Model with name \"%s\" does not exists", $name));
    }

Usage Example

예제 #1
0
파일: Schema.php 프로젝트: dumplie/dumplie
 /**
  * @param string $typeName
  *
  * @return TypeSchema
  * @throws NotFoundException
  */
 public function get(string $typeName) : TypeSchema
 {
     if (!array_key_exists($typeName, $this->types)) {
         throw NotFoundException::model($typeName);
     }
     return $this->types[$typeName];
 }