pendalf89\filemanager\behaviors\MediafileBehavior::updateOwners PHP Method

updateOwners() public method

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