12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace think\model;
- use think\Collection as BaseCollection;
- use think\Model;
- class Collection extends BaseCollection
- {
-
- public function load($relation)
- {
- $item = current($this->items);
- $item->eagerlyResultSet($this->items, $relation);
- return $this;
- }
-
- public function hidden($hidden = [], $override = false)
- {
- $this->each(function ($model) use ($hidden, $override) {
-
- $model->hidden($hidden, $override);
- });
- return $this;
- }
-
- public function visible($visible = [], $override = false)
- {
- $this->each(function ($model) use ($visible, $override) {
-
- $model->visible($visible, $override);
- });
- return $this;
- }
-
- public function append($append = [], $override = false)
- {
- $this->each(function ($model) use ($append, $override) {
-
- $model && $model->append($append, $override);
- });
- return $this;
- }
- }
|