Merge pull request #3043 from githubjeka/v1.3-dev-mixin

autocomplete PHPStorm for behaviors for Content's models [skip ci]
This commit is contained in:
Lucas Bartholemy 2018-02-25 19:30:18 +01:00 committed by GitHub
commit efbaee2338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

@ -45,6 +45,7 @@ use humhub\modules\content\interfaces\ContentOwner;
* Note: If the underlying Content record cannot be saved or validated an Exception will thrown.
*
* @property Content $content
* @mixin \humhub\modules\user\behaviors\Followable
* @author Luke
*/
class ContentActiveRecord extends ActiveRecord implements ContentOwner

View File

@ -41,7 +41,8 @@ use yii\rbac\Permission;
* @property string $stream_channel
* @property integer $contentcontainer_id;
* @property ContentContainerActiveRecord $container
*
* @mixin \humhub\components\behaviors\PolymorphicRelation
* @mixin \humhub\components\behaviors\GUID
* @since 0.5
*/
class Content extends ContentDeprecated
@ -73,7 +74,7 @@ class Content extends ContentDeprecated
* @var ContentContainerActiveRecord the Container (e.g. Space or User) where this content belongs to.
*/
protected $_container = null;
/**
* @var bool flag to disable the creation of default social activities like activity and notifications in afterSave() at content creation.
* @deprecated since v1.2.3 use ContentActiveRecord::silentContentCreation instead.
@ -87,8 +88,8 @@ class Content extends ContentDeprecated
{
return [
[
'class' => \humhub\components\behaviors\PolymorphicRelation::className(),
'mustBeInstanceOf' => array(ContentActiveRecord::className()),
'class' => \humhub\components\behaviors\PolymorphicRelation::class,
'mustBeInstanceOf' => [ContentActiveRecord::class],
],
[
'class' => \humhub\components\behaviors\GUID::className(),
@ -594,7 +595,7 @@ class Content extends ContentDeprecated
if ($user->isSystemAdmin() && Yii::$app->getModule('content')->adminCanViewAllContent) {
return true;
}
if ($this->isPrivate() && $this->getContainer() !== null && $this->getContainer()->canAccessPrivateContent($user)) {
return true;
}

View File

@ -20,6 +20,7 @@ use humhub\modules\content\components\ContentContainerActiveRecord;
* @property string $class
* @property integer $pk
* @property integer $owner_user_id
* @mixin PolymorphicRelation
*/
class ContentContainer extends \yii\db\ActiveRecord
{