From c9068e25d43066c7776daea368cfa9b2675e56eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aryel=20Mota=20G=C3=B3is?= Date: Sat, 17 Feb 2018 12:33:42 -0300 Subject: [PATCH 1/3] Add unreleased sections --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f08ddd..b6d0833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +### Changed + +### Deprecated + +### Removed + +### Fixed + +### Security + ## [4.0.0] - 2018-02-17 From 82ba26fc3d5644de16f73855dbc6d0376c0982dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aryel=20Mota=20G=C3=B3is?= Date: Sat, 17 Feb 2018 15:04:08 -0300 Subject: [PATCH 2/3] Add Person getDocumentType() and getFormatedDocument() --- CHANGELOG.md | 3 +++ src/Models/Person.php | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6d0833..df6581e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Added +- Model methods: + - `getDocumentType()` + - `getFormatedDocument()` ### Changed diff --git a/src/Models/Person.php b/src/Models/Person.php index 9175fbc..b2dcb6a 100644 --- a/src/Models/Person.php +++ b/src/Models/Person.php @@ -56,6 +56,31 @@ public static function documentFormat($document, $prepend = false) return Utils\Format::document($document, $prepend); } + /** + * Returns Person's document formated + * + * @param boolean $prepend @see documentFormat() + * + * @return integer Document type + * @return false If document is invalid or not set + */ + public function getDocumentType() + { + return static::documentValidate($this->document)['type'] ?? false; + } + + /** + * Returns Person's document formated + * + * @param boolean $prepend @see documentFormat() + * + * @return ... same as documentFormat() + */ + public function getFormatedDocument($prepend = false) + { + return static::documentFormat($this->document, $prepend); + } + /** * Called when a column is changed * From 4bbff52655c77e5136c318abc4249b4f3cbd63ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aryel=20Mota=20G=C3=B3is?= Date: Sat, 17 Feb 2018 15:11:43 -0300 Subject: [PATCH 3/3] Prepare 4.1.0 --- CHANGELOG.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df6581e..97e5a26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,21 +10,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] + +## [4.1.0] - 2018-02-17 + ### Added - Model methods: - `getDocumentType()` - `getFormatedDocument()` -### Changed - -### Deprecated - -### Removed - -### Fixed - -### Security - ## [4.0.0] - 2018-02-17 @@ -187,7 +180,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - DatabaseObject.php -[Unreleased]: https://github.com/aryelgois/Medools/compare/v4.0.0...develop +[Unreleased]: https://github.com/aryelgois/Medools/compare/v4.1.0...develop +[4.1.0]: https://github.com/aryelgois/Medools/compare/v4.0.0...v4.1.0 [4.0.0]: https://github.com/aryelgois/Medools/compare/v3.1.0...v4.0.0 [3.1.1]: https://github.com/aryelgois/Medools/compare/v3.1.0...v3.1.1 [3.1.0]: https://github.com/aryelgois/Medools/compare/v3.0...v3.1.0