Final Class Yiisoft\ActiveRecord\Internal\LazyLoadResultSet
| Inheritance | Yiisoft\ |
|---|
Counts the records of one result set that lazy loaded a relation. The counts are freed together with the result set they belong to, which the records are the only reference to.
See also Yiisoft\
Public Methods
| Method | Description | Defined By |
|---|---|---|
| registerLazyLoad() | Registers a record that lazy loaded the relation and returns the number of records of this result set that have loaded it. A record that loads the relation again, after {@see ActiveRecordInterface::resetRelation()} or {@see ActiveRecordInterface::refresh()} dropped it, is counted once. | Yiisoft\ |
Method Details
Registers a record that lazy loaded the relation and returns the number of records of this result set that have loaded it. A record that loads the relation again, after {@see ActiveRecordInterface::resetRelation()} or {@see ActiveRecordInterface::refresh()} dropped it, is counted once.
| public integer registerLazyLoad ( Yiisoft\ | ||
| $record | Yiisoft\ |
|
| $relation | string | |
public function registerLazyLoad(ActiveRecordInterface $record, string $relation): int
{
$this->records[$relation][spl_object_id($record)] = true;
return count($this->records[$relation]);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.