コード例 #1
0
 /**
  * @param StatusInterface $status
  */
 public function __construct(StatusInterface $status)
 {
     parent::__construct();
     $this->id = $status->getId();
     $this->setName($status->getName());
     $this->setPublished($status->isPublished());
     $this->setInitial($status->isInitial());
     $this->setDisplayColor($status->getDisplayColor());
     $this->setLabels($status->getLabels());
     $this->setBlockedEdition($status->isBlockedEdition());
     $this->setOutOfWorkflow($status->isOutOfWorkflow());
     foreach ($status->getToRoles() as $toRole) {
         $this->addToRole($toRole);
     }
     foreach ($status->getFromRoles() as $fromRole) {
         $this->addFromRole($fromRole);
     }
 }
コード例 #2
0
 /**
  * @param string|\Symfony\Component\Form\FormTypeInterface $type
  * @param null                                             $data
  * @param array                                            $options
  * @param string|null                                      $editionRole
  * @param StatusInterface|null                             $status
  *
  * @return \Symfony\Component\Form\Form
  */
 public function createForm($type, $data = null, array $options = array(), $editionRole = null, StatusInterface $status = null)
 {
     if (null !== $status && $status->isBlockedEdition()) {
         $options['disabled'] = true;
     }
     return parent::createForm($type, $data, $options, $editionRole);
 }