31 if ($this->idColumn === null) {
35 return $this->owner->{$this->idColumn};
44 public function getName()
46 if ($this->nameColumn === null) {
50 return $this->owner->{$this->nameColumn};
58 public function getAssignmentNameLink()
60 return CHtml::link($this->getName(), array(
'assignment/user',
'id' => $this->getId()));
71 public function getAssignmentsText($type)
73 $assignedItems = $this->getAssignments();
75 if (isset($assignedItems[ $type ]) ===
true) {
76 $items = $assignedItems[ $type ];
78 foreach ($items as $itemname => $item) {
79 $names[] = $item->getNameText();
82 return implode(
'<br />', $names);
91 public function getAssignments()
93 if ($this->_assignments !== null) {
94 return $this->_assignments;
97 $authAssignments = $authorizer->authManager->getAuthAssignments($this->getId());
98 $nestedItems = $authorizer->authManager->getAuthItemsByNames(array_keys($authAssignments),
true);
100 $assignments = array();
101 foreach ($nestedItems as $type => $items) {
102 $items = $authorizer->attachAuthItemBehavior($items);
103 $assignments[ $type ] = array();
104 foreach ($items as $itemName => $item) {
105 $assignments[ $type ][ $itemName ] = $item;
109 return $this->_assignments = $assignments;