public function updateOwners()
    {
        foreach ($this->attributes as $attr) {
            Mediafile::removeOwner($this->owner->primaryKey, $this->name, $attr);

            if ($mediafile = $this->loadModel($this->owner->$attr)) {
                $mediafile->addOwner($this->owner->primaryKey, $this->name, $attr);
            }
        }
    }
public function updateOwners()
    {
        foreach ($this->attributes as $attr) {
            Mediafile::removeOwner($this->owner->primaryKey, $this->name, $attr);

            if ($mediafile = $this->loadModel($this->owner->$attr)) {
                $mediafile->addOwner($this->owner->primaryKey, $this->name, $attr);
            }
        }
    }
public function updateOwners ( ) { foreach ( $ this -> attributes as $ attr ) { Mediafile :: removeOwner ( $ this -> owner -> primaryKey , $ this -> name , $ attr ) ; if ( $ mediafile = $ this -> loadModel ( $ this -> owner -> $ attr ) ) { $ mediafile -> addOwner ( $ this -> owner -> primaryKey , $ this -> name , $ attr ) ; } } }
Update owners of mediafile
Update owners of mediafile