LLMS_Section::toArrayAfter( array $arr )
Add data to the course model when converted to array
Description Description
Called before data is sorted and returned by $this->jsonSerialize().
Parameters Parameters
- $arr
-
(array) (Required) Data to be serialized.
Return Return
(array)
Source Source
File: includes/models/model.llms.section.php
public function toArrayAfter( $arr ) {
$arr['lessons'] = array();
foreach ( $this->get_lessons() as $lesson ) {
$arr['lessons'][] = $lesson->toArray();
}
return $arr;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.3.0 | |
| 3.24.0 | Introduced. |