checkPartLimit() public method

Checks if the amount of parts is exceeded.
public checkPartLimit ( ) : boolean
return boolean
Example #1
0
 /**
  * Injects the specific root node ID if "@local-tree-root" was specified
  *
  * @param Request $request
  *
  * @return mixed
  *
  * @throws RuntimeException
  * @throws PartLimitExceededException
  */
 public function __invoke(Request $request)
 {
     /**
      * @var $resourceType ResourceInterface
      */
     if ($this->partService->checkPartLimit()) {
         throw new PartLimitExceededException();
     }
     list($resourceType, $format) = $this->extractAttributes($request);
     return $this->serializer->deserialize($request->getContent(), $resourceType->getEntityClass(), $format, $resourceType->getDenormalizationContext());
 }
Example #2
0
 /**
  * Injects the specific root node ID if "@local-tree-root" was specified.
  *
  * @param Request $request
  *
  * @throws RuntimeException
  * @throws PartLimitExceededException
  * @throws InternalPartNumberNotUniqueException
  *
  * @return mixed
  */
 public function __invoke(Request $request)
 {
     if ($this->partService->checkPartLimit()) {
         throw new PartLimitExceededException();
     }
     /**
      * @var $resourceType ResourceInterface
      */
     list($resourceType, $format) = $this->extractAttributes($request);
     /**
      * @var $part Part
      */
     $part = $this->serializer->deserialize($request->getContent(), $resourceType->getEntityClass(), $format, $resourceType->getDenormalizationContext());
     if (!$this->partService->isInternalPartNumberUnique($part->getInternalPartNumber())) {
         throw new InternalPartNumberNotUniqueException();
     }
     return $part;
 }