PartKeepr\PartBundle\Services\PartService::checkPartLimit PHP Method

checkPartLimit() public method

Checks if the amount of parts is exceeded.
public checkPartLimit ( ) : boolean
return boolean
    public function checkPartLimit()
    {
        if ($this->partLimit !== false) {
            if ($this->getPartCount() >= $this->partLimit) {
                return true;
            }
        }
        return false;
    }

Usage Example

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());
 }
All Usage Examples Of PartKeepr\PartBundle\Services\PartService::checkPartLimit