Set the decorated event publisher

@param   EventPublisherInterface $delegate The decorated event publisher
@return  EventPublisherProfiler
@throws  \InvalidArgumentException If the delegate is not an event publisher
336932
public function setDelegate($delegate)
    {
        if (!$delegate instanceof EventPublisherInterface) {
            throw new \InvalidArgumentException('Delegate: '.get_class($delegate).' does not implement EventPublisherInterface');
        }

        return parent::setDelegate($delegate);
    }
610166
public function publish(\DateTimeInterface $publicationDate)
    {
        $this->guardPublish() ?: $this->apply(
            $this->createPublishedEvent($publicationDate)
        );
    }
1058777
public function setDatePublishStart($datePublishStart = null)
    {
        if (!isset($datePublishStart) || is_string($datePublishStart)) {
            $datePublishStart = new \DateTime($datePublishStart);
        } elseif (!$datePublishStart instanceof \DateTime) {
            throw new \InvalidArgumentException('Expected object of type \DateTime');
        }

        $this->datePublishStart = $datePublishStart;
        return $this;
    }
304635
public function setPrivacy($privacy)
    {
        if (!in_array($privacy, array(
            self::PRIVACY_ALL_FRIENDS,
            self::PRIVACY_EVERYONE,
            self::PRIVACY_FRIENDS_OF_FRIENDS,
            self::PRIVACY_SELF
        ))) {
            throw new \InvalidArgumentException("Invalid Facebook status privacy.");
        }
        $this->privacy = $privacy;

        return $this;
    }
514334
public function addEntity(EntityInterface $entity)
    {
        if (!is_a($entity, $this->type)) {
            throw new InvalidArgumentException(
                "Trying to add an entity that is not a {$this->type}."
            );
        }
        $this->data[] = $entity;
        $event = new EntityAdded($entity, ['collection' => $this]);
        $this->getEmitter()->emit($event);
        return $this;
    }
101813
public function create(MessageCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $message = new MessageModel();

        $message
            ->setDispatcher($dispatcher)

            ->setName($event->getMessageName())
            ->setLocale($event->getLocale())
            ->setTitle($event->getTitle())
            ->setSecured($event->getSecured())

            ->save()
        ;

        $event->setMessage($message);
    }
977537
public function setDelegate($delegate)
    {
        if (!$delegate instanceof ControllerToolbarInterface) {
            throw new \InvalidArgumentException('Delegate: '.get_class($delegate).' does not implement ControllerToolbarInterface');
        }

        return parent::setDelegate($delegate);
    }
452799
public function create(FeatureCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $feature = new FeatureModel();

        $feature
            ->setDispatcher($dispatcher)

            ->setLocale($event->getLocale())
            ->setTitle($event->getTitle())

            ->save()
        ;

        $event->setFeature($feature);

        // Add atribute to all product templates if required
        if ($event->getAddToAllTemplates() != 0) {
            $this->doAddToAllTemplates($feature);
        }
    }
978970
protected function handlePublication(PublishableInterface $entity, $eventName)
    {
        if (!$this->enabled) {
            return;
        }
        $class = $this->publicationEventClass;
        $event = new $class($entity, $eventName);

        $serialized = $this->getSerializer()->serialize($event, $this->getFormat());
        $f = $this->getFileName($eventName, $entity->getPublicationUuid());
        if (false === file_put_contents($f, $serialized)) {
            throw new FileException("Unable to write to file {$f}");
        }
    }
136735
public function setEventManager( EventManagerInterface $events )
    {
        $events->setEventClass( __NAMESPACE__ . '\Event' );
        $events->attach( Event::EVENT_LOGIN,  array( $this, 'onLogin' ),  1000 );
        $events->attach( Event::EVENT_LOGOUT, array( $this, 'onLogout' ), 0    );
        return parent::setEventManager( $events );
    }
96259
public function setType($type)
    {
        if (!self::isValidType($type)) {
            throw new \InvalidArgumentException("$type is not a valid event type");
        }

        $this->type = $type;

        return $this;
    }
776899
public function setPublishing($publishing = null)
    {
        if ($publishing === null) {
            $this->_publishing = null;
        } else {
            $this->_publishing = $this->validatePublishing($publishing);
        }

        return $this;
    }
830338
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
	{
		$this->eventDispatcher = $eventDispatcher;
		$this->twig->setEventDispatcher($eventDispatcher);
	}
672825
public function setPublisher($publisher)
    {
        ObjectHelper::isInstanceOf($publisher, [Organization::class, Person::class]);
        
        $this->_publisher = $publisher;
        return $this;
    }
27118
public function setPublisher($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->publisher !== $v) {
            $this->publisher = $v;
            $this->modifiedColumns[ReferenceTableMap::COL_PUBLISHER] = true;
        }

        return $this;
    }
582310
public function setEventManager(EventManagerInterface $eventManager)
    {
        $class = get_class($this);
        $eventManager->setIdentifiers(array(
            strtr($class, '\\', '.'),
            $class
        ));

        $this->eventManager = $eventManager;
        return $this;
    }
723820
public function setEventResponse($eventResponse)
    {
        $allowed_values = array('declined', 'not_responded', 'accepted', 'tentative');
        if (!is_null($eventResponse) && (!in_array($eventResponse, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'eventResponse', must be one of 'declined', 'not_responded', 'accepted', 'tentative'");
        }
        $this->container['eventResponse'] = $eventResponse;

        return $this;
    }