Property | Type | Description | |
---|---|---|---|
$actsAs | array | Behaviors used by the Model | |
$belongsTo | array | Model associations: belongsTo | |
$filterArgs | array | Filter search fields | |
$findMethods | |||
$guid | string | Guid | |
$name | string | Model name | |
$type | string | If the Model is associated to Node model, this variable holds the Node type value | |
$validate | array | Validation |
Method | Description | |
---|---|---|
beforeFind ( $queryData ) : array | beforeFind callback | |
beforeSave ( $options = [] ) : boolean | beforeSave callback | |
filterNodes ( $data = [] ) : array | Return filter condition for Nodes | |
filterPublishedNodes ( $data = [] ) : array | Return filter condition for Nodes | |
formatData ( array $data, string $typeAlias = self::DEFAULT_TYPE ) : array | Format data for saving | |
isUniquePerType ( array $fields, boolean $or = true ) : boolean | Returns false if any fields passed match any (by default, all if $or = false) of their matching values. | |
saveNode ( $data, $typeAlias = self::DEFAULT_TYPE ) : mixed | Create/update a Node record | |
updateAllNodesPaths ( ) : boolean | array | Update values for all nodes 'path' field |
Method | Description | |
---|---|---|
_findPromoted ( $state, $query, $results = [] ) | Find promoted nodes | |
_findPublished ( $state, $query, $results = [] ) | Search published nodes | |
_findViewById ( $state, $query, $results = [] ) | Find a single node by id | |
_findViewBySlug ( $state, $query, $results = [] ) | Find a single node by slug | |
_getNodeRelativePath ( array $node ) : string | getNodeRelativePath | |
_getType ( array $data ) : string | _getType | |
_mergeQueryFilters ( &$query, $key, $values ) : void | mergeQueryFilters |
protected _findPromoted ( $state, $query, $results = [] ) |
protected _findPublished ( $state, $query, $results = [] ) |
protected _findViewById ( $state, $query, $results = [] ) |
protected _findViewBySlug ( $state, $query, $results = [] ) |
protected _getNodeRelativePath ( array $node ) : string | ||
$node | array | Node array |
return | string | relative node path |
protected _mergeQueryFilters ( &$query, $key, $values ) : void | ||
return | void |
public beforeFind ( $queryData ) : array | ||
return | array |
public beforeSave ( $options = [] ) : boolean | ||
return | boolean |
public filterNodes ( $data = [] ) : array | ||
return | array | Array of conditions |
public filterPublishedNodes ( $data = [] ) : array | ||
return | array | Array of conditions |
public isUniquePerType ( array $fields, boolean $or = true ) : boolean | ||
$fields | array | Field/value pairs to search (if no values specified, they are pulled from $this->data) |
$or | boolean | If false, all fields specified must match in order for a false return value |
return | boolean | False if any records matching any fields are found |
public updateAllNodesPaths ( ) : boolean | array | ||
return | boolean | array | Depending on atomicity |
public string $type | ||
return | string |