/** * Check the restrictions against the information within the event and determine if the callback shall be executed. * * @codingStandardsIgnoreStart * @param BuildWidgetEvent|DecodePropertyValueForWidgetEvent|EncodePropertyValueFromWidgetEvent|GetPropertyOptionsEvent $event The Event for which the callback shall be invoked. * @codingStandardsIgnoreEnd * * @return bool */ public function wantToExecute($event) { if (method_exists($event, 'getPropertyName')) { $property = $event->getPropertyName(); } else { if ($event->getProperty() instanceof PropertyInterface) { $property = $event->getProperty()->getName(); } else { $property = $event->getProperty(); } } return parent::wantToExecute($event) && (empty($this->propertyName) || $property == $this->propertyName); }
/** * Check the restrictions against the information within the event and determine if the callback shall be executed. * * @param GetOperationButtonEvent $event The Event for which the callback shall be invoked. * * @return bool */ public function wantToExecute($event) { return parent::wantToExecute($event) && (empty($this->operationName) || $event->getKey() == $this->operationName); }