for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Itstructure\MFUploader\behaviors;
use yii\db\ActiveRecordInterface;
use Itstructure\MFUploader\models\{Mediafile, OwnerMediafile};
/**
* Class BehaviorMediafile
* BehaviorMediafile class to add, update and remove owners of Mediafile model.
*
* @package Itstructure\MFUploader\behaviors
* @author Andrey Girnik <[email protected]>
*/
class BehaviorMediafile extends Behavior
{
* Load Mediafile model by conditions.
* @param array $conditions
* @return Mediafile|ActiveRecordInterface|null
protected function loadModel(array $conditions)
return Mediafile::findOne($conditions);
}
* Remove owner of Mediafile model.
* @param int $ownerId
* @param string $owner
* @param string $ownerAttribute
* @return bool
protected function removeOwner(int $ownerId, string $owner, string $ownerAttribute): bool
return OwnerMediafile::removeOwner($ownerId, $owner, $ownerAttribute);