1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-12 02:25:18 +02:00

[ticket/11495] Remove item classes

PHPBB3-11495
This commit is contained in:
Joas Schilling 2013-04-18 00:15:02 +02:00
parent 8c3443ba99
commit 86937e03ec
3 changed files with 0 additions and 171 deletions

View File

@ -1,82 +0,0 @@
<?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;
}
}

View File

@ -1,28 +0,0 @@
<?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;
}
class phpbb_nestedset_item_forum extends phpbb_nestedset_item_base
{
public function __construct(array $forum_row)
{
$this->item_id = (int) $forum_row['forum_id'];
$this->parent_id = (int) $forum_row['parent_id'];
$this->left_id = (int) $forum_row['left_id'];
$this->right_id = (int) $forum_row['right_id'];
$this->item_parents_data = (string) $forum_row['forum_parents'];
}
}

View File

@ -1,61 +0,0 @@
<?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;
}
interface phpbb_nestedset_item_interface
{
/**
* Returns the ID of the item
*
* @return int
*/
public function get_item_id();
/**
* Returns the ID of the parent item
*
* @return int
*/
public function get_parent_id();
/**
* Returns a serialized or empty string with the data of the item's parents
*
* @return string
*/
public function get_item_parents_data();
/**
* Returns the left_id of the item
*
* @return int
*/
public function get_left_id();
/**
* Returns the right_id of the item
*
* @return int
*/
public function get_right_id();
/**
* Does the item have sub-items?
*
* @return bool
*/
public function has_children();
}