| @@ -24,9 +24,9 @@ | ||
| 24 | 24 | * |
| 25 | 25 | * @param object $collection Optional attributes. |
| 26 | 26 | */ |
| 27 | 27 | public function __construct( $collection ) { |
| 28 | - $this->attributes = (object) $collection; | |
| 28 | + $this->attributes = $collection; | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Get the called class name |
| @@ -37,26 +37,8 @@ | ||
| 37 | 37 | return str_replace( '\\', '_', get_called_class() ); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | - * Get the total. | |
| 42 | - * | |
| 43 | - * @return string | |
| 44 | - */ | |
| 45 | - public function total() { | |
| 46 | - return $this->pagination->count ?? 0; | |
| 47 | - } | |
| 48 | - | |
| 49 | - /** | |
| 50 | - * Get the total pages. | |
| 51 | - * | |
| 52 | - * @return string | |
| 53 | - */ | |
| 54 | - public function totalPages() { | |
| 55 | - return ceil( ( $this->pagination->count ?? 0 ) / ( $this->pagination->limit ?? 1 ) ); | |
| 56 | - } | |
| 57 | - | |
| 58 | - /** | |
| 59 | 41 | * Does this collection have a next page? |
| 60 | 42 | * |
| 61 | 43 | * @return boolean |
| 62 | 44 | */ |
| @@ -140,9 +122,8 @@ | ||
| 140 | 122 | * |
| 141 | 123 | * @param mixed $offset Name. |
| 142 | 124 | * @return mixed |
| 143 | 125 | */ |
| 144 | - #[\ReturnTypeWillChange] | |
| 145 | 126 | public function offsetGet( $offset ) { |
| 146 | 127 | return $this->getAttribute( $offset ); |
| 147 | 128 | } |
| 148 | 129 | |