本文整理汇总了PHP中Symfony\Component\EventDispatcher\GenericEvent::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP GenericEvent::__construct方法的具体用法?PHP GenericEvent::__construct怎么用?PHP GenericEvent::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\EventDispatcher\GenericEvent
的用法示例。
在下文中一共展示了GenericEvent::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($subject, array $arguments = array())
{
parent::__construct($subject, $arguments);
if (!$subject instanceof TeamMemberInterface) {
throw new \InvalidArgumentException('This is not a valid TeamMemberInterface');
}
}
示例2: __construct
/**
* Constructor
*
* @param string $eventName
* @param string $entityType
* @param EntityInterface[] $entities
* @param int $userId
* @param array $arguments
*/
public function __construct($eventName, $entityType, array $entities, $userId = null, array $arguments = [])
{
$this->setEventName($eventName);
$this->setEntityType($entityType);
$this->setUserId($userId);
// Keeping the 'uid' in arguments allows compatibility with the
// makinacorpus/apubsub API, using subject too
parent::__construct($entities, $arguments + ['uid' => $userId]);
}
示例3: __construct
/**
* Constructor
*
* @param string $eventName
* @param string $entityType
* @param EntityInterface $entity
* @param int $userId
* @param array $arguments
*/
public function __construct($eventName, $entityType, EntityInterface $entity, $userId = null, array $arguments = [])
{
$this->setEventName($eventName);
$this->setEntityType($entityType);
$this->setUserId($userId);
list($id, , $bundle) = entity_extract_ids($entityType, $entity);
// Keeping the 'uid' in arguments allows compatibility with the
// makinacorpus/apubsub API, using subject too
parent::__construct($entity, $arguments + ['uid' => $userId, 'id' => $id, 'bundle' => $bundle]);
}
示例4: __construct
public function __construct($subject = null, ProfileInterface $profile = null, BackupInterface $backup = null, WorkflowActivityInterface $activity = null)
{
parent::__construct($subject, array('profile' => $profile, 'backup' => $backup, 'activity' => $activity));
}
示例5: __construct
public function __construct(ContainerInterface $container, array $arguments = array())
{
$this->container = $container;
parent::__construct($container, $arguments);
}
示例6: __construct
/**
* @param mixed $subject
* @param int $subjectId
* @param array $arguments
*/
public function __construct($subject, $subjectId, array $arguments = [])
{
parent::__construct($subject, $arguments);
$this->subjectId = $subjectId;
}
示例7: __construct
/**
* @param object $subject
* @param EventArgs $parent
* @param array|null $arguments
*/
public function __construct($subject, EventArgs $parent, array $arguments = array())
{
parent::__construct($subject, $arguments);
$this->parent = $parent;
}
示例8: __construct
/**
* Encapsulate an event with $subject, $args, and $data.
*
* @param mixed $subject Usually an object or other PHP callable.
* @param array $args Arguments to store in the event.
* @param mixed $data Convenience argument of data for optional processing.
*/
public function __construct($subject = null, array $args = array(), $data = null)
{
$this->data = $data;
parent::__construct($subject, $args);
}
示例9: __construct
/**
* EventArgs constructor.
* @param array $arguments
* @param Request $request
*/
public function __construct(array $arguments = array(), Request $request = null)
{
parent::__construct(null, $arguments);
$this->request = $request;
}
示例10: __construct
public function __construct(ClassMetadataBuilder $classMetadataBuilder, array $arguments = [])
{
parent::__construct($classMetadataBuilder, $arguments);
$this->classMetadataBuilder = $classMetadataBuilder;
}
示例11: __construct
/**
* Construct GenericEvent object.
*
* @param Object $subject The subject of the event
* @param array $arguments The arguments passed to event listener.
*/
public function __construct($subject = null, array $arguments = array())
{
parent::__construct($subject, $arguments);
}
示例12: __construct
/**
* Constructor.
*
* @param string $eventName
* @param array $subject
* @param mixed $data
*/
public function __construct($eventName, $subject, $data)
{
parent::__construct($subject, $data);
$this->eventName = $eventName;
}
示例13: __construct
public function __construct(Request $request, $resource)
{
parent::__construct($resource);
$this->request = $request;
}
示例14: __construct
public function __construct($result, array $arguments = [])
{
parent::__construct($result, $arguments);
$this->result = $result;
}
示例15: __construct
/**
* Default constructor
*
* @param string $resourceType
* @param scalar|scalar[] $resourceId
* @param mixed $resource
* @param scalar|scalar[] $userId
* @param array $data
*/
public function __construct($resourceType, $resourceIdList, $userId = null, array $data = [])
{
parent::__construct(null, $data + ['uid' => $userId]);
$this->resourceType = $resourceType;
$this->resourceIdList = Misc::toArray($resourceIdList);
}