Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aryelgois committed Feb 17, 2018
2 parents 3e4043a + 4bbff52 commit f22bc78
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,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()`


## [4.0.0] - 2018-02-17

### Added
Expand Down Expand Up @@ -172,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
Expand Down
25 changes: 25 additions & 0 deletions src/Models/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit f22bc78

Please sign in to comment.