public function __construct(Step $step, $userIds = []) { $this->step = $step; $this->userIds = $userIds; $this->details = ['unlock' => ['path' => $step->getPath()->getId(), 'step' => $step->getId(), 'stepname' => $step->getName()]]; parent::__construct($step->getPath()->getResourceNode(), $this->details); }
/** * Transform Step data to export it * @param \Innova\PathBundle\Entity\Step $step * @return array */ public function export(Step $step) { $parent = $step->getParent(); $activity = $step->getActivity(); $data = array('uid' => $step->getId(), 'parent' => !empty($parent) ? $parent->getId() : null, 'activityId' => !empty($activity) ? $activity->getId() : null, 'activityNodeId' => !empty($activity) ? $activity->getResourceNode()->getId() : null, 'order' => $step->getOrder(), 'lvl' => $step->getLvl(), 'inheritedResources' => array()); $inheritedResources = $step->getInheritedResources(); foreach ($inheritedResources as $inherited) { $data['inheritedResources'][] = array('resource' => $inherited->getResource()->getId(), 'lvl' => $inherited->getLvl()); } return $data; }
public function jsonSerialize() { return array('id' => $this->id, 'userId' => $this->user->getId(), 'stepId' => $this->step->getId(), 'status' => $this->status, 'authorized' => $this->authorized); }
public function jsonSerialize() { return ['id' => $this->id, 'userId' => $this->user instanceof User ? $this->user->getId() : 0, 'stepId' => $this->step->getId(), 'status' => $this->status, 'authorized' => $this->authorized, 'locked' => $this->locked, 'lockedcall' => $this->lockedcall]; }