From c465e4b88cd412b4bbd6601b1801bd9227ef5fde Mon Sep 17 00:00:00 2001 From: Ludovic Janot Date: Mon, 28 Jun 2021 11:17:11 +0200 Subject: [PATCH] Remove usage of Timber\PostCollection in Repository - See gihub issues #53 & #54 --- .../app/Repositories/Repository.php | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/template/web/wp-content/themes/<%= slug %>/app/Repositories/Repository.php b/template/web/wp-content/themes/<%= slug %>/app/Repositories/Repository.php index 2cb59d8..baa6a29 100644 --- a/template/web/wp-content/themes/<%= slug %>/app/Repositories/Repository.php +++ b/template/web/wp-content/themes/<%= slug %>/app/Repositories/Repository.php @@ -8,8 +8,6 @@ namespace Studiometa\Repositories; -use Timber\PostCollection; - /** Class */ abstract class Repository { /** @@ -39,28 +37,6 @@ public function first() { return isset( $local_array[0] ) ? $local_array[0] : null; } - /** - * Returns a slice of the collection starting at the given index. - * Similar to Laravel's slice(). - * - * @param int $start Start index. - * - * @return array - */ - public function slice( $start ) { - $local_array = $this->get(); - - if ( count( $local_array ) < 1 ) { - return array(); - } - - if ( is_object( $local_array ) && $local_array instanceof PostCollection ) { - $local_array = $local_array->getArrayCopy(); - } - - return array_slice( $local_array, (int) $start ); - } - /** * Runs a query. *