23 abstract public function join($obj);
60 abstract public function leave($obj);
67 abstract public function is($obj);
102 abstract protected function createNode($parent = NULL);
141 foreach($childNodes as $node){
142 $obj = $node->{$type};
144 $objects[$obj->id] = $obj;
155 $parentNodes = $this->getDirectParentNodes(NULL);
159 foreach($parentNodes as $node){
160 $obj = $node->{$type};
162 $objects[$obj->id] = $obj;
174 return self::loadObjectsStatic($identifier, $model,
true);
184 $model = get_class($this);
185 return self::loadObjectsStatic($identifier, $model,
true);
193 public function loadObjects($identifier, $model = NULL, $onlyFirst =
true){
195 $model = get_class($this);
196 return self::loadObjects($identifier, $model, $onlyFirst);
224 if(is_string($model)){
226 $model =
new $class();
235 if(is_string($identifier)){
237 $objects = $model->$method(
'alias=:alias', array(
'alias' => $identifier));
241 throw new Exception(
'Unknown alias for ACL-ObjectCollection');
245 $obj->alias = $identifier;
248 $objects = $onlyFirst ? $obj : array($obj);
256 is_array($identifier) &&
257 (isset($identifier[
'foreign_key']) && isset($identifier[
'model']))
260 $objects = $model->$method(
'foreign_key = :foreign_key AND model = :model',
261 array(
':foreign_key' => $identifier[
'foreign_key'],
':model' => $identifier[
'model']));
264 throw new Exception(
'Unknown foreign key and/or model for ACL-ObjectCollection');
268 $obj->foreign_key = $identifier[
'foreign_key'];
269 $obj->model = $identifier[
'model'];
272 $objects = $onlyFirst ? $obj : array($obj);
279 elseif(is_a($identifier,
"AclObject") || (
280 is_a($identifier,
"HiddenClass")
281 && is_subclass_of($identifier->pretends(),
"Aclobject")
283 $objects = $identifier;
285 elseif(is_a($identifier,
"CActiveRecord")){
286 return self::loadObjectsStatic( array(
'model' => get_class($identifier),
'foreign_key' => $identifier->id), $model, $onlyFirst);
289 throw new Exception(
'Unknown ACL-Object specification');
305 return $class::model()->findAll(
'collection_id = :id', array(
':id' => $this->
id));
315 if($this->isNewRecord){
325 if(is_subclass_of($this->model,
"CActiveRecord")){
326 $model = $this->model;
327 return $model::model()->findByPk($this->foreign_key);
336 $args = func_get_args();
337 foreach($args as $arg){
338 if(is_object($arg) && is_a($arg,
"CActiveRecord") && $arg->getIsNewRecord()){
340 throw new RuntimeException(
'Unable to save object');
352 $obj = $this->loadObject($obj);
354 $this->assureSaved($this, $obj);