Loading src/UnicaenAuth/View/Helper/UserProfileSelectRadioItem.php +7 −5 Original line number Diff line number Diff line <?php namespace UnicaenAuth\View\Helper; use Application\Acl\Role; use Zend\Permissions\Acl\Role\RoleInterface; use Zend\Form\Element\Radio; /** Loading @@ -14,7 +14,7 @@ use Zend\Form\Element\Radio; class UserProfileSelectRadioItem extends UserAbstract { /** * @var Role * @var RoleInterface */ protected $role; Loading @@ -30,11 +30,11 @@ class UserProfileSelectRadioItem extends UserAbstract /** * * @param Role $role * @param RoleInterface $role * @param bool $selected * @return self */ public function __invoke(Role $role, $selected = false) public function __invoke(RoleInterface $role, $selected = false) { $this->role = $role; $this->selected = $selected; Loading Loading @@ -74,10 +74,12 @@ class UserProfileSelectRadioItem extends UserAbstract $id = $this->role->getRoleId(); $inputClass = 'user-profile-select-input'; $roleToString = method_exists($this->role, '__toString') ? (string) $this->role : $this->role->getRoleId(); // rendu sous forme de radio $radio = new Radio('role'); $radio ->setValueOptions(array($id => (string) $this->role)) ->setValueOptions(array($id => $roleToString)) ->setAttribute('class', $inputClass) ->setAttribute('title', "Cliquez pour changer de profil courant") ->setValue($this->selected ? $id : null); Loading Loading
src/UnicaenAuth/View/Helper/UserProfileSelectRadioItem.php +7 −5 Original line number Diff line number Diff line <?php namespace UnicaenAuth\View\Helper; use Application\Acl\Role; use Zend\Permissions\Acl\Role\RoleInterface; use Zend\Form\Element\Radio; /** Loading @@ -14,7 +14,7 @@ use Zend\Form\Element\Radio; class UserProfileSelectRadioItem extends UserAbstract { /** * @var Role * @var RoleInterface */ protected $role; Loading @@ -30,11 +30,11 @@ class UserProfileSelectRadioItem extends UserAbstract /** * * @param Role $role * @param RoleInterface $role * @param bool $selected * @return self */ public function __invoke(Role $role, $selected = false) public function __invoke(RoleInterface $role, $selected = false) { $this->role = $role; $this->selected = $selected; Loading Loading @@ -74,10 +74,12 @@ class UserProfileSelectRadioItem extends UserAbstract $id = $this->role->getRoleId(); $inputClass = 'user-profile-select-input'; $roleToString = method_exists($this->role, '__toString') ? (string) $this->role : $this->role->getRoleId(); // rendu sous forme de radio $radio = new Radio('role'); $radio ->setValueOptions(array($id => (string) $this->role)) ->setValueOptions(array($id => $roleToString)) ->setAttribute('class', $inputClass) ->setAttribute('title', "Cliquez pour changer de profil courant") ->setValue($this->selected ? $id : null); Loading