public function create() { if ($this->getType() !== self::TYPE_TICKET) { throw new BadMethodCallException('You can create only note of type "ticket"'); } parent::create(); }