コード例 #1
0
 /**
  * Populates the parser object with the properties parser and the class object.
  *
  * @param string         $className
  * @param RequestParser  $parserObject
  * @param RequestBuilder $requestBuilder
  *
  * @return RequestParser
  */
 public function populateRequestParser($className, RequestParser $parserObject, RequestBuilder $requestBuilder)
 {
     $parserObject->setRequestObject(new $className());
     foreach ($this->reflectionService->getClassProperties($className) as $property) {
         $parserObject->addPropertyParser($this->getPropertyParserBuilder($property)->build($requestBuilder));
     }
     return $parserObject;
 }
コード例 #2
0
 /**
  * @param array         $request
  * @param RequestParser $parserObject
  */
 private function parseArray(array $request, RequestParser $parserObject)
 {
     $return = [];
     foreach ($request as $requestItem) {
         $return[] = $parserObject->parse($requestItem);
     }
     return $return;
 }