From 5e83ac03ac5a14e3bf570fa84dc1746b99d6ae4c Mon Sep 17 00:00:00 2001 From: Basil Suter Date: Tue, 19 Sep 2017 13:01:54 +0200 Subject: [PATCH] remove deprecated methods #1505 --- CHANGELOG.md | 1 + docs/guide/ngrest-model.md | 4 ++-- modules/admin/src/storage/ItemAbstract.php | 9 --------- modules/admin/src/traits/SoftDeleteTrait.php | 12 ++++-------- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cad24df4c..be30eccfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. This projec ### Changed +- [#1505](https://github.com/luyadev/luya/issues/1505) Minor API Breaks and removed deprecated methods. - [#1341](https://github.com/luyadev/luya/issues/1341) Changed signature of `changePassword($newPassword)` in `luya\admin\aws\ChangePasswordInterface`. ### Added diff --git a/docs/guide/ngrest-model.md b/docs/guide/ngrest-model.md index 353df359f..6c05d1681 100644 --- a/docs/guide/ngrest-model.md +++ b/docs/guide/ngrest-model.md @@ -245,10 +245,10 @@ We have also added a soft delete trait {{\luya\admin\traits\SoftDeleteTrait}} wh use luya\admin\traits\SoftDeleteTrait; ``` -By default, soft delete trait will use the field `is_deleted` to find and delete data records, you can configure the field by overriding the `FieldStateDescriber` method as followed: +By default, soft delete trait will use the field `is_deleted` to find and delete data records, you can configure the field by overriding the {{luya\admin\traits\SoftDeleteTrait::fieldStateDescriber()}} method as followed: ```php -public static function FieldStateDescriber() +public static function fieldStateDescriber() { return [ 'is_deleted' => [1, 0], // on delete sets `is_deleted = 1`; on find add where `where(['is_deleted' => 0]);`. diff --git a/modules/admin/src/storage/ItemAbstract.php b/modules/admin/src/storage/ItemAbstract.php index c0726ba16..4a467db2d 100644 --- a/modules/admin/src/storage/ItemAbstract.php +++ b/modules/admin/src/storage/ItemAbstract.php @@ -26,15 +26,6 @@ public function setItemArray(array $item) { $this->_itemArray = $item; } - - /** - * @deprecated Remove. - * @return unknown - */ - public function getItemArray() - { - return $this->_itemArray; - } /** * Method to construct/build the item from Iterator or Query class. diff --git a/modules/admin/src/traits/SoftDeleteTrait.php b/modules/admin/src/traits/SoftDeleteTrait.php index 6461898f2..7736f4182 100644 --- a/modules/admin/src/traits/SoftDeleteTrait.php +++ b/modules/admin/src/traits/SoftDeleteTrait.php @@ -6,7 +6,7 @@ * Trait to enable Soft Deletion for NgRest and ActiveRecord models. * * To override a match your custom field desribers (describers which is deleted and find state) you - * can override the static `FieldStateDescriber()` method as described in the description of the method. + * can override the static `fieldStateDescriber()` method as described in the description of the method. * * @author Basil Suter */ @@ -24,7 +24,6 @@ trait SoftDeleteTrait * ]; * ``` * - * @todo rename to fieldStateDescriber! * @return array Returns an array with a key which desribes what field should be updated on delete and observed on find, * the value for the corresponding field can be an array or a string/numeric * @@ -32,11 +31,8 @@ trait SoftDeleteTrait * - string/nummeric: The value will be inverted with "!" opposite operator, this can lead into problems * * if you want to override the default implemenation to match your custom models you should always use the former type of state description. - * - * @todo rename to fieldStateDescriber - * @deprecated remove in 1.0.0 replace with fieldStateDescriber */ - public static function FieldStateDescriber() + public static function fieldStateDescriber() { return [ 'is_deleted' => [true, false] @@ -52,7 +48,7 @@ public static function internalAndWhere() { $query = []; - foreach (static::FieldStateDescriber() as $field => $value) { + foreach (static::fieldStateDescriber() as $field => $value) { $query[$field] = (is_array($value)) ? $value[1] : !$value; } @@ -104,7 +100,7 @@ public function delete() private static function internalUpdateValues() { $update = []; - foreach (static::FieldStateDescriber() as $field => $value) { + foreach (static::fieldStateDescriber() as $field => $value) { $update[$field] = (is_array($value)) ? $value[0] : $value; } return $update;