diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-04-16 23:08:35 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-04-16 23:08:35 +0200 |
commit | 0d5efcc1d569b3907eebfacef84ac0be3fd11143 (patch) | |
tree | 3782c4532095aad2d5cf3778123a71255ce7876e /phpBB/includes/nestedset/item | |
parent | a1183a58894967bfec7da01c5004138e4daeb583 (diff) | |
download | forums-0d5efcc1d569b3907eebfacef84ac0be3fd11143.tar forums-0d5efcc1d569b3907eebfacef84ac0be3fd11143.tar.gz forums-0d5efcc1d569b3907eebfacef84ac0be3fd11143.tar.bz2 forums-0d5efcc1d569b3907eebfacef84ac0be3fd11143.tar.xz forums-0d5efcc1d569b3907eebfacef84ac0be3fd11143.zip |
[ticket/11495] Add abstract implementation of the interface
PHPBB3-11495
Diffstat (limited to 'phpBB/includes/nestedset/item')
-rw-r--r-- | phpBB/includes/nestedset/item/base.php | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/phpBB/includes/nestedset/item/base.php b/phpBB/includes/nestedset/item/base.php new file mode 100644 index 0000000000..c3a7600827 --- /dev/null +++ b/phpBB/includes/nestedset/item/base.php @@ -0,0 +1,82 @@ +<?php +/** +* +* @package Nested Set +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +abstract class phpbb_nestedset_item_base implements phpbb_nestedset_item_interface +{ + /** @var int */ + protected $item_id; + + /** @var int */ + protected $parent_id; + + /** @var string */ + protected $item_parents_data; + + /** @var int */ + protected $left_id; + + /** @var int */ + protected $right_id; + + /** + * @inheritdoc + */ + public function get_item_id() + { + return (int) $this->item_id; + } + + /** + * @inheritdoc + */ + public function get_parent_id() + { + return (int) $this->parent_id; + } + + /** + * @inheritdoc + */ + public function get_item_parents_data() + { + return (string) $this->item_parents_data; + } + + /** + * @inheritdoc + */ + public function get_left_id() + { + return (int) $this->left_id; + } + + /** + * @inheritdoc + */ + public function get_right_id() + { + return (int) $this->right_id; + } + + /** + * @inheritdoc + */ + public function has_children() + { + return $this->right_id - $this->left_id > 1; + } +} |