Class lispa\amos\cwh\utility\CwhUtil
Inheritance | lispa\amos\cwh\utility\CwhUtil |
---|
Class CwhUtil
Public Methods
Method | Description | Defined By |
---|---|---|
createCwhView() | Create cwh nodi view if not exists or regenerate it regenerate the table cwh nodi (materialization of the view Cwh nodi view contains all network records based on the queries of cwh config table. | lispa\amos\cwh\utility\CwhUtil |
deleteNetworkContents() | Delete the contents published in the specified network scope. | lispa\amos\cwh\utility\CwhUtil |
getDomainNames() | Given the list of CwhNodes id (as array o string with comma separator), get the list as domains name separeted by comma | lispa\amos\cwh\utility\CwhUtil |
getNetworkContents() | Get the contents published for the specified network as an array structure array[configContentInfo] => ContentModel[] - config content info to use as array key is configurable with parameter $arrayKeyFromConfigContentsField array key not present if no content of that content type has been published for the network | lispa\amos\cwh\utility\CwhUtil |
getNetworkCwhRuleIds() | This method returns an array with the cwh publication rule ids for all users in network and all users with tag in network. | lispa\amos\cwh\utility\CwhUtil |
getPlatformCwhRuleIds() | This method returns an array with the cwh publication rule ids for all users and all users with tag. | lispa\amos\cwh\utility\CwhUtil |
getPublicationRuleLabel() | lispa\amos\cwh\utility\CwhUtil | |
getPublicationRulesQuery() | Query for publication rules enabled for logged user | lispa\amos\cwh\utility\CwhUtil |
getTagNames() | lispa\amos\cwh\utility\CwhUtil | |
getUserNetworkQuery() | Query for network models in user network, given the network type configuration. | lispa\amos\cwh\utility\CwhUtil |
setCwhAuthAssignments() | Given a user_network_mm record set the correct cwh auth assignment permission for content models enabled in cwh Specify $modelClassName if only permissions for specified content model type must be set | lispa\amos\cwh\utility\CwhUtil |
Method Details
Create cwh nodi view if not exists or regenerate it regenerate the table cwh nodi (materialization of the view Cwh nodi view contains all network records based on the queries of cwh config table.
public static void createCwhView ( ) |
Delete the contents published in the specified network scope.
In case more more scopes are set, only the specified network publication scope is deleted, not the content itself.
public static void deleteNetworkContents ( $configId, $networkId ) | ||
$configId | ||
$networkId | integer |
|
Given the list of CwhNodes id (as array o string with comma separator), get the list as domains name separeted by comma
public static string getDomainNames ( $cwhNodeIds ) | ||
$cwhNodeIds | mixed |
Get the contents published for the specified network as an array structure array[configContentInfo] => ContentModel[] - config content info to use as array key is configurable with parameter $arrayKeyFromConfigContentsField array key not present if no content of that content type has been published for the network
public static array getNetworkContents ( $configId, $networkId, $arrayKeyFromConfigContentsField = 'tablename' ) | ||
$configId | ||
$networkId | integer |
|
$arrayKeyFromConfigContentsField | string |
|
return | array | Eg.or returned array [ ['news'] => News[], ['documenti'] => Documenti[] ] |
---|
This method returns an array with the cwh publication rule ids for all users in network and all users with tag in network.
public static array getNetworkCwhRuleIds ( ) |
This method returns an array with the cwh publication rule ids for all users and all users with tag.
public static array getPlatformCwhRuleIds ( ) |
public static string getPublicationRuleLabel ( $publicationRuleId ) | ||
$publicationRuleId | integer | |
return | string |
|
---|
Query for publication rules enabled for logged user
public static lispa\amos\cwh\models\query\CwhRegolePubblicazioneQuery|mixed getPublicationRulesQuery ( ) | ||
return | lispa\amos\cwh\models\query\CwhRegolePubblicazioneQuery|mixed | $publicationRulesQuery |
---|
public static string getTagNames ( $tagIds ) | ||
$tagIds | array|string |
|
return | string |
|
---|
Query for network models in user network, given the network type configuration.
public static yii\db\ActiveQuery|null getUserNetworkQuery ( $cwhConfigId, $userId = null, $checkActive = true ) | ||
$cwhConfigId | integer |
|
$userId | integer|null |
|
$checkActive | boolean|true |
|
return | yii\db\ActiveQuery|null | $networksQuery |
---|
Given a user_network_mm record set the correct cwh auth assignment permission for content models enabled in cwh Specify $modelClassName if only permissions for specified content model type must be set
public static void setCwhAuthAssignments ( $network = null, $networkUserMmRow, $delete = false, $modelClassName = null, $cwhConfig = null ) | ||
$network | lispa\amos\cwh\base\ModelNetworkInterface|null |
|
$networkUserMmRow |
|
|
$delete | boolean|false |
|
$modelClassName | string|null | |
$cwhConfig | lispa\amos\cwh\models\CwhConfig|null |