예제 #1
0
 /**
  * @param bool $lazyChecks
  * @return Model | null
  * @throws GraphException
  */
 public static function getByRequest($lazyChecks = false)
 {
     $req = Graphene::getInstance()->getRequest();
     $requestModels = ModelFactory::createByRequest($req, null, $lazyChecks);
     if (isset($requestModels[self::stcName()])) {
         return $requestModels[self::stcName()];
     } else {
         throw new GraphException('Sent model is not valid for' . self::stcName(), 400, 400);
     }
 }