repository-aborts-trait.php
3 years ago
repository-dynamic-items-it.php
3 years ago
repository-item-dynamic-id.php
3 years ago
repository-item-instance-trait.php
3 years ago
repository-item-with-class.php
3 years ago
repository-pattern-trait.php
3 years ago
repository-static-item-it.php
3 years ago
repository-aborts-trait.php
44 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Classes\Repository; |
| 5 | |
| 6 | use Jet_Form_Builder\Exceptions\Repository_Exception; |
| 7 | |
| 8 | trait Repository_Aborts_Trait { |
| 9 | |
| 10 | /** |
| 11 | * @throws Repository_Exception |
| 12 | */ |
| 13 | final public function _rep_abort_this() { |
| 14 | throw ( new Repository_Exception( 'replace this...' ) )->set_code( $this->_rep_abort_this_code() ); |
| 15 | } |
| 16 | |
| 17 | final public function _rep_abort_this_code() { |
| 18 | return 1; |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * @throws Repository_Exception |
| 23 | */ |
| 24 | final public function _rep_abort_all() { |
| 25 | throw ( new Repository_Exception( 'replace this...' ) )->set_code( $this->_rep_abort_all_code() ); |
| 26 | } |
| 27 | |
| 28 | final public function _rep_abort_all_code() { |
| 29 | return 2; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * @throws Repository_Exception |
| 34 | */ |
| 35 | final public function _rep_abort_and_die() { |
| 36 | throw ( new Repository_Exception( 'replace this...' ) )->set_code( $this->_rep_abort_and_die_code() ); |
| 37 | } |
| 38 | |
| 39 | final public function _rep_abort_and_die_code() { |
| 40 | return 3; |
| 41 | } |
| 42 | |
| 43 | } |
| 44 |