Méthode | Description | |
---|---|---|
attributes ( ) : array | Returns the list of all attribute names of the model. | |
callKeywords ( string $text, boolean $fetchStatistic = false ) : array | Returns tokenized and normalized forms of the keywords, and, optionally, keyword statistics. | |
callSnippets ( string | array $source, string $match, array $options = [] ) : string | array | Builds a snippet from provided data and query, using specified index settings. | |
delete ( ) : integer | false | Deletes the index entry corresponding to this active record. | |
deleteAll ( string | array $condition = '', array $params = [] ) : integer | Deletes rows in the index using the provided conditions. | |
equals ( |
Returns a value indicating whether the given active record is the same as the current one. | |
find ( ) : |
||
findBySql ( string $sql, array $params = [] ) : |
Creates an ActiveQuery instance with a given SQL statement. | |
getDb ( ) : |
Returns the Sphinx connection used by this AR class. | |
getIndexSchema ( ) : |
Returns the schema information of the Sphinx index associated with this AR class. | |
getSnippet ( string $match = null, array $options = [] ) : string | Returns current snippet value or generates new one from given match. | |
getSnippetSource ( ) : string | Returns the string, which should be used as a source to create snippet for this Active Record instance. | |
indexName ( ) : string | Declares the name of the Sphinx index associated with this AR class. | |
insert ( boolean $runValidation = true, array $attributes = null ) : boolean | Inserts a row into the associated Sphinx index using the attribute values of this record. | |
isTransactional ( integer $operation ) : boolean | Returns a value indicating whether the specified operation is transactional in the current [[scenario]]. | |
populateRecord ( $record, $row ) | ||
primaryKey ( ) : string[] | Returns the primary key name for this AR class. | |
setSnippet ( string $snippet ) | ||
transactions ( ) : array | Declares which operations should be performed within a transaction in different scenarios. | |
update ( boolean $runValidation = true, array $attributeNames = null ) : integer | false | Saves the changes to this active record into the associated Sphinx index. | |
updateAll ( array $attributes, string | array $condition = '', array $params = [] ) : integer | Updates the whole table using the provided attribute values and conditions. |
Méthode | Description | |
---|---|---|
fetchSnippet ( string $match, array $options = [] ) : string | Builds up the snippet value from the given query. | |
updateInternal ( $attributes = null ) |
Méthode | Description | |
---|---|---|
insertInternal ( $attributes = null ) |
public attributes ( ) : array | ||
Résultat | array | list of attribute names. |
public static callSnippets ( string | array $source, string $match, array $options = [] ) : string | array | ||
$source | string | array | is the source data to extract a snippet from. It could be either a single string or array of strings. |
$match | string | the full-text query to build snippets for. |
$options | array | list of options in format: optionName => optionValue |
Résultat | string | array | built snippet in case "source" is a string, list of built snippets in case "source" is an array. |
public static deleteAll ( string | array $condition = '', array $params = [] ) : integer | ||
$condition | string | array | the conditions that will be put in the WHERE part of the DELETE SQL. Please refer to [[Query::where()]] on how to specify this parameter. |
$params | array | the parameters (name => value) to be bound to the query. |
Résultat | integer | the number of rows deleted |
public static find ( ) : |
||
Résultat | the newly created [[ActiveQuery]] instance. |
public static getDb ( ) : |
||
Résultat | the Sphinx connection used by this AR class. |
public static getIndexSchema ( ) : |
||
Résultat | the schema information of the Sphinx index associated with this AR class. |
public getSnippetSource ( ) : string | ||
Résultat | string | snippet source string. |
public insert ( boolean $runValidation = true, array $attributes = null ) : boolean | ||
$runValidation | boolean | whether to perform validation before saving the record. If the validation fails, the record will not be inserted. |
$attributes | array | list of attributes that need to be saved. Defaults to null, meaning all attributes that are loaded from index will be saved. |
Résultat | boolean | whether the attributes are valid and the record is inserted successfully. |
public isTransactional ( integer $operation ) : boolean | ||
$operation | integer | the operation to check. Possible values are [[OP_INSERT]], [[OP_UPDATE]] and [[OP_DELETE]]. |
Résultat | boolean | whether the specified operation is transactional in the current [[scenario]]. |
public static primaryKey ( ) : string[] | ||
Résultat | string[] | the primary keys of the associated Sphinx index. |
public transactions ( ) : array | ||
Résultat | array | the declarations of transactional operations. The array keys are scenarios names, and the array values are the corresponding transaction operations. |
public update ( boolean $runValidation = true, array $attributeNames = null ) : integer | false | ||
$runValidation | boolean | whether to perform validation before saving the record. If the validation fails, the record will not be inserted into the database. |
$attributeNames | array | list of attributes that need to be saved. Defaults to null, meaning all attributes that are loaded from DB will be saved. |
Résultat | integer | false | the number of rows affected, or `false` if validation fails or [[beforeSave()]] stops the updating process. |
public static updateAll ( array $attributes, string | array $condition = '', array $params = [] ) : integer | ||
$attributes | array | attribute values (name-value pairs) to be saved into the table |
$condition | string | array | the conditions that will be put in the WHERE part of the UPDATE SQL. Please refer to [[Query::where()]] on how to specify this parameter. |
$params | array | the parameters (name => value) to be bound to the query. |
Résultat | integer | the number of rows updated |