pendalf89\filemanager\models\Mediafile::loadOneByOwner PHP Method

loadOneByOwner() public static method

public static loadOneByOwner ( $owner, $owner_id, $owner_attribute )
    public static function loadOneByOwner($owner, $owner_id, $owner_attribute)
    {
        $owner = Owners::findOne(['owner' => $owner, 'owner_id' => $owner_id, 'owner_attribute' => $owner_attribute]);
        if ($owner) {
            return $owner->mediafile;
        }
        return false;
    }

Usage Example

Beispiel #1
0
 /**
  * @return bool|Mediafile
  */
 public function getThumbnailModel()
 {
     if (!empty($this->thumbnail_model)) {
         return $this->thumbnail_model;
     }
     return $this->thumbnail_model = Mediafile::loadOneByOwner('post', $this->id, 'thumbnail');
 }
All Usage Examples Of pendalf89\filemanager\models\Mediafile::loadOneByOwner