protected function validateObject() { $object = $this->request->getBasket(); if (!$object || !$object instanceof Basket) { throw new ValidationError('Basket is not set.'); } }