Class lispa\amos\cwh\query\CwhActiveQuery
Class CwhActiveQuery
Public Properties
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\Component |
__clone() | Clones internal objects. | yii\db\ActiveRelationTrait |
__construct() | Constructor. | yii\db\ActiveQuery |
__get() | Returns the value of a component property. | yii\base\Component |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\Component |
__set() | Sets the value of a component property. | yii\base\Component |
__unset() | Sets a component property to be null. | yii\base\Component |
addGroupBy() | Adds additional group-by columns to the existing ones. | yii\db\Query |
addOrderBy() | Adds additional ORDER BY columns to the query. | yii\db\QueryTrait |
addParams() | Adds additional parameters to be bound to the query. | yii\db\Query |
addSelect() | Add more columns to the SELECT part of the query. | yii\db\Query |
alias() | Define an alias for the table defined in $modelClass. | yii\db\ActiveQuery |
all() | Executes query and returns all results as an array. | yii\db\ActiveQuery |
andFilterCompare() | Adds a filtering condition for a specific column and allow the user to choose a filter operator. | yii\db\Query |
andFilterHaving() | Adds an additional HAVING condition to the existing one but ignores empty operands. | yii\db\Query |
andFilterWhere() | Adds an additional WHERE condition to the existing one but ignores empty operands. | yii\db\QueryTrait |
andHaving() | Adds an additional HAVING condition to the existing one. | yii\db\Query |
andOnCondition() | Adds an additional ON condition to the existing one. | yii\db\ActiveQuery |
andWhere() | Adds an additional WHERE condition to the existing one. | yii\db\QueryTrait |
asArray() | Sets the asArray() property. | yii\db\ActiveQueryTrait |
attachBehavior() | Attaches a behavior to this component. | yii\base\Component |
attachBehaviors() | Attaches a list of behaviors to the component. | yii\base\Component |
average() | Returns the average of the specified column values. | yii\db\Query |
batch() | Starts a batch query. | yii\db\Query |
behaviors() | Returns a list of behaviors that this component should behave as. | yii\base\Component |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\Component |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\Component |
className() | Returns the fully qualified name of this class. | yii\base\Object |
column() | Executes the query and returns the first column of the result. | yii\db\Query |
count() | Returns the number of records. | yii\db\Query |
create() | Creates a new Query object and copies its property values from an existing one. | yii\db\Query |
createCommand() | Creates a DB command that can be used to execute this query. | yii\db\ActiveQuery |
detachBehavior() | Detaches a behavior from the component. | yii\base\Component |
detachBehaviors() | Detaches all behaviors from the component. | yii\base\Component |
distinct() | Sets the value indicating whether to SELECT DISTINCT or not. | yii\db\Query |
each() | Starts a batch query and retrieves data row by row. | yii\db\Query |
emulateExecution() | Sets whether to emulate query execution, preventing any interaction with data storage. | yii\db\QueryTrait |
ensureBehaviors() | Makes sure that the behaviors declared in behaviors() are attached to this component. | yii\base\Component |
exists() | Returns a value indicating whether the query result contains any row of data. | yii\db\Query |
filterByPublicationNetwork() | Query getting the contents published in a specific network scope. | lispa\amos\cwh\query\CwhActiveQuery |
filterByScope() | Filter contents by a specific set of entities if the scope filter was setted (eg. filter by organization, community,. | lispa\amos\cwh\query\CwhActiveQuery |
filterByScopeValidation() | Filter contents by a specific set of validation entities if the scope filter was setted (eg. filter by organization, community,. | lispa\amos\cwh\query\CwhActiveQuery |
filterHaving() | Sets the HAVING part of the query but ignores empty operands. | yii\db\Query |
filterValidatedByScope() | Filter contents by a status validated and by a specific set of entities if the scope filter was setted (eg. filter by organization, community,. | lispa\amos\cwh\query\CwhActiveQuery |
filterWhere() | Sets the WHERE part of the query but ignores empty operands. | yii\db\QueryTrait |
findFor() | Finds the related records for the specified primary record. | yii\db\ActiveRelationTrait |
findWith() | Finds records corresponding to one or multiple relations and populates them into the primary models. | yii\db\ActiveQueryTrait |
from() | Sets the FROM part of the query. | yii\db\Query |
getBehavior() | Returns the named behavior object. | yii\base\Component |
getBehaviors() | Returns all behaviors attached to this component. | yii\base\Component |
getPublicationJoin() | lispa\amos\cwh\query\CwhActiveQuery | |
getQueryAllUsers() | Create the query fetching contents when the logged user interests match at least one tag of that content | lispa\amos\cwh\query\CwhActiveQuery |
getQueryCwhAll() | Search specific content type objects in status validated | lispa\amos\cwh\query\CwhActiveQuery |
getQueryCwhDraft() | Search specific content type objects created by the logged user and in status draft | lispa\amos\cwh\query\CwhActiveQuery |
getQueryCwhOwn() | Search specific content type objects created by the logged user | lispa\amos\cwh\query\CwhActiveQuery |
getQueryCwhOwnInterest() | Search specific content type objects in status validated and visible by logged user (based on publication rule and visibility) | lispa\amos\cwh\query\CwhActiveQuery |
getQueryCwhToValidate() | Search specific content type objects in status to validate and visible by logged user | lispa\amos\cwh\query\CwhActiveQuery |
getRecipients() | lispa\amos\cwh\query\CwhActiveQuery | |
getRecipientsNetwork() | lispa\amos\cwh\query\CwhActiveQuery | |
getRecipientsTag() | lispa\amos\cwh\query\CwhActiveQuery | |
getTablesUsedInFrom() | Returns table names used in from() indexed by aliases. | yii\db\ActiveQuery |
getTagMatchQuery() | Create the query fetching contents when the logged user interests match: - tagsMatchEachTree = false : at least one tag of that content - tagsMatchEachTree = true : at least one tag of that content for each tree enabled | lispa\amos\cwh\query\CwhActiveQuery |
getUserId() | lispa\amos\cwh\query\CwhActiveQuery | |
getUserNetworkAndTagQuery() | Create the query fetching contents published in a network scope when the logged user belong to the network and has matching tags | lispa\amos\cwh\query\CwhActiveQuery |
getUserNetworkQuery() | Create the query fetching contents published in a network scope when the logged user belong to the network | lispa\amos\cwh\query\CwhActiveQuery |
getUserNetworksQuery() | Query for CwhNodi (networks) of which user is member. | lispa\amos\cwh\query\CwhActiveQuery |
getUserProfile() | lispa\amos\cwh\query\CwhActiveQuery | |
getUserTagQuery() | Create the query fetching contents when the logged user interests match (publication rule = 2) | lispa\amos\cwh\query\CwhActiveQuery |
getVisibilityQuery() | lispa\amos\cwh\query\CwhActiveQuery | |
groupBy() | Sets the GROUP BY part of the query. | yii\db\Query |
hasEventHandlers() | Returns a value indicating whether there is any handler attached to the named event. | yii\base\Component |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\Component |
hasProperty() | Returns a value indicating whether a property is defined for this component. | yii\base\Component |
having() | Sets the HAVING part of the query. | yii\db\Query |
indexBy() | Sets the indexBy() property. | yii\db\QueryTrait |
init() | Initializes the object. | lispa\amos\cwh\query\CwhActiveQuery |
innerJoin() | Appends an INNER JOIN part to the query. | yii\db\Query |
innerJoinWith() | Inner joins with the specified relations. | yii\db\ActiveQuery |
inverseOf() | Sets the name of the relation that is the inverse of this relation. | yii\db\ActiveRelationTrait |
join() | Appends a JOIN part to the query. | yii\db\Query |
joinPublication() | lispa\amos\cwh\query\CwhActiveQuery | |
joinWith() | Joins with the specified relations. | yii\db\ActiveQuery |
leftJoin() | Appends a LEFT OUTER JOIN part to the query. | yii\db\Query |
limit() | Sets the LIMIT part of the query. | yii\db\QueryTrait |
max() | Returns the maximum of the specified column values. | yii\db\Query |
min() | Returns the minimum of the specified column values. | yii\db\Query |
off() | Detaches an existing event handler from this component. | yii\base\Component |
offset() | Sets the OFFSET part of the query. | yii\db\QueryTrait |
on() | Attaches an event handler to an event. | yii\base\Component |
onCondition() | Sets the ON condition for a relational query. | yii\db\ActiveQuery |
one() | Executes query and returns a single row of result. | yii\db\ActiveQuery |
orFilterHaving() | Adds an additional HAVING condition to the existing one but ignores empty operands. | yii\db\Query |
orFilterWhere() | Adds an additional WHERE condition to the existing one but ignores empty operands. | yii\db\QueryTrait |
orHaving() | Adds an additional HAVING condition to the existing one. | yii\db\Query |
orOnCondition() | Adds an additional ON condition to the existing one. | yii\db\ActiveQuery |
orWhere() | Adds an additional WHERE condition to the existing one. | yii\db\QueryTrait |
orderBy() | Sets the ORDER BY part of the query. | yii\db\QueryTrait |
params() | Sets the parameters to be bound to the query. | yii\db\Query |
populate() | Converts the raw query results into the format as specified by this query. | yii\db\ActiveQuery |
populateRelation() | Finds the related records and populates them into the primary models. | yii\db\ActiveRelationTrait |
prepare() | Prepares for building SQL. | yii\db\ActiveQuery |
rightJoin() | Appends a RIGHT OUTER JOIN part to the query. | yii\db\Query |
scalar() | Returns the query result as a scalar value. | yii\db\Query |
select() | Sets the SELECT part of the query. | yii\db\Query |
setUserId() | lispa\amos\cwh\query\CwhActiveQuery | |
setUserProfile() | lispa\amos\cwh\query\CwhActiveQuery | |
sum() | Returns the sum of the specified column values. | yii\db\Query |
trigger() | Triggers an event. | yii\base\Component |
union() | Appends a SQL statement using UNION operator. | yii\db\Query |
via() | Specifies the relation associated with the junction table. | yii\db\ActiveRelationTrait |
viaTable() | Specifies the junction table for a relational query. | yii\db\ActiveQuery |
where() | Sets the WHERE part of the query. | yii\db\QueryTrait |
with() | Specifies the relations with which this query should be performed. | yii\db\ActiveQueryTrait |
Protected Methods
Method | Description | Defined By |
---|---|---|
createModels() | Converts found rows into model instances | yii\db\ActiveQueryTrait |
filterCondition() | Removes empty operands from the given query condition. | yii\db\QueryTrait |
getPrimaryTableName() | yii\db\ActiveQuery | |
isEmpty() | Returns a value indicating whether the give value is "empty". | yii\db\QueryTrait |
normalizeOrderBy() | Normalizes format of ORDER BY data | yii\db\QueryTrait |
queryScalar() | Queries a scalar value by setting select() first. | yii\db\ActiveQuery |
Events
Event | Type | Description | Defined By |
---|---|---|---|
EVENT_INIT | \yii\db\Event | An event that is triggered when the query is initialized via init(). | yii\db\ActiveQuery |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
RULE_NETWORK | 3 | Id of Publication rule for 'all user based in the network scope' | lispa\amos\cwh\query\CwhActiveQuery |
RULE_NETWORK_TAG | 4 | Id of Publication rule for 'all user based in the network scope and matching tag interest' | lispa\amos\cwh\query\CwhActiveQuery |
RULE_PUBLIC | 1 | Id of Publication rule for 'All users' | lispa\amos\cwh\query\CwhActiveQuery |
RULE_TAG | 2 | Id of Publication rule for 'all user with matching tag interest' | lispa\amos\cwh\query\CwhActiveQuery |
Property Details
The modelClass of content to search
ModelObject
- customized id/ array ids of networks for filter by scope Query
The initial query to search for content without added cwh conditions
$query
$query
$query
$query
$query
The required worklflow status of the content to search
The table name of content to search (eg news, documents, ..)
- if null the logged user id is considered
$query
Method Details
Query getting the contents published in a specific network scope.
public $this filterByPublicationNetwork ( $configId, $networkId ) | ||
$configId | integer |
|
$networkId | integer |
|
Filter contents by a specific set of entities if the scope filter was setted (eg. filter by organization, community,.
.)
public void filterByScope ( $query ) | ||
$query | yii\db\ActiveQuery | The query to obtain contents still not filtered by scope |
Filter contents by a specific set of validation entities if the scope filter was setted (eg. filter by organization, community,.
.)
public void filterByScopeValidation ( $query ) | ||
$query | yii\db\ActiveQuery | The query to obtain contents still not filtered by scope |
Filter contents by a status validated and by a specific set of entities if the scope filter was setted (eg. filter by organization, community,.
.)
public void filterValidatedByScope ( $query ) | ||
$query | yii\db\ActiveQuery | The query to obtain contents still not filtered by status ans scope |
public void getPublicationJoin ( $query ) | ||
$query | yii\db\ActiveQuery |
Create the query fetching contents when the logged user interests match at least one tag of that content
public yii\db\ActiveQuery getQueryAllUsers ( $publicationRules ) | ||
$publicationRules | array | The list of publication rules for which content type filter by tags has to be selected |
return | yii\db\ActiveQuery | $query |
---|
Search specific content type objects in status validated
public yii\db\ActiveQuery getQueryCwhAll ( $cwhConfigId = null, $cwhNetworkId = null ) | ||
$cwhConfigId | ||
$cwhNetworkId | ||
return | yii\db\ActiveQuery | $query |
---|
Search specific content type objects created by the logged user and in status draft
public yii\db\ActiveQuery getQueryCwhDraft ( ) | ||
return | yii\db\ActiveQuery | $query |
---|
Search specific content type objects created by the logged user
public yii\db\ActiveQuery getQueryCwhOwn ( ) | ||
return | yii\db\ActiveQuery | $query |
---|
Search specific content type objects in status validated and visible by logged user (based on publication rule and visibility)
public yii\db\ActiveQuery getQueryCwhOwnInterest ( ) | ||
return | yii\db\ActiveQuery | $query |
---|
Search specific content type objects in status to validate and visible by logged user
public yii\db\ActiveQuery getQueryCwhToValidate ( $checkStatus = true ) | ||
$checkStatus | boolean | |
return | yii\db\ActiveQuery | $query |
---|
public void getRecipients ( $publicationRule, $tagValues = [], $scopes = [] ) | ||
$publicationRule | ||
$tagValues | ||
$scopes |
public mixed getRecipientsNetwork ( $query, $scopes ) | ||
$query | ||
$scopes |
public $this getRecipientsTag ( $query, $tagValues ) | ||
$query | ||
$tagValues |
Create the query fetching contents when the logged user interests match: - tagsMatchEachTree = false : at least one tag of that content - tagsMatchEachTree = true : at least one tag of that content for each tree enabled
public yii\db\ActiveQuery getTagMatchQuery ( $query ) | ||
$query | yii\db\ActiveQuery | |
return | yii\db\ActiveQuery | $query |
---|
public integer getUserId ( ) |
Create the query fetching contents published in a network scope when the logged user belong to the network and has matching tags
public yii\db\ActiveQuery getUserNetworkAndTagQuery ( $publicationRules ) | ||
$publicationRules | array | The list of publication rules for which content type filter by network has to be selected |
return | yii\db\ActiveQuery | $query |
---|
Create the query fetching contents published in a network scope when the logged user belong to the network
public yii\db\ActiveQuery getUserNetworkQuery ( $publicationRules = null ) | ||
$publicationRules | array | The list of publication rules for which content type filter by network has to be selected |
return | yii\db\ActiveQuery | $query |
---|
Query for CwhNodi (networks) of which user is member.
public static mixed getUserNetworksQuery ( $userId = null ) | ||
$userId | integer |
|
public mixed getUserProfile ( ) |
Create the query fetching contents when the logged user interests match (publication rule = 2)
public yii\db\ActiveQuery getUserTagQuery ( $publicationRules ) | ||
$publicationRules | array | The list of publication rules for which content type filter by tags has to be selected |
return | yii\db\ActiveQuery | $query |
---|
public yii\db\ActiveQuery getVisibilityQuery ( $query, $publicationRules = null, $checkUser = true ) | ||
$query | yii\db\ActiveQuery | |
$publicationRules | null|array | |
$checkUser | boolean|true |
|
return | yii\db\ActiveQuery | $query |
---|
Initializes the object.
This method is called at the end of the constructor. The default implementation will trigger an EVENT_INIT event. If you override this method, make sure you call the parent implementation at the end to ensure triggering of the event.
public void init ( ) | ||
throws | \lispa\amos\cwh\query\InvalidConfigException, | CwhException |
---|
public $this joinPublication ( ) |
public void setUserId ( $userId ) | ||
$userId |
public void setUserProfile ( $userprofile ) | ||
$userprofile |