Ignore:
Timestamp:
Feb 20, 2014 3:03:59 AM (10 years ago)
Author:
anonymous
Message:

Completed integrating /branches/eli_branch into /trunk. Changes include:

  • Removed closing ?> from end of files
  • Upgrade old-style contructor methods to use construct() instead.
  • Class properties and methods defined as public, private, static or protected
  • Ensure code runs under E_ALL with only mysql_* deprecated warnings
  • Search for the '@' symbol anywhere it might be used to supress runtime errors, then replace with proper error recovery.
  • Run the php cli -l option to check files for syntax errors.
  • Bring tests up-to-date with latest version and methods of PHPUnit
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/lib/Hierarchy.inc.php

    r441 r468  
    5252     *
    5353     */
    54     var $params = array();
     54    public $params = array();
    5555
    5656
     
    5959     * @var string $child_type
    6060     */
    61     var $child_type;
     61    public $child_type;
    6262
    6363    /**
     
    6565     * @var string $child_id
    6666     */
    67     var $child_id;
     67    public $child_id;
    6868
    6969    /**
     
    7272     * @var bool $node_init
    7373     */
    74     var $node_init = false;
     74    public $node_init = false;
    7575
    7676    /**
     
    8080     *                          configuration or connection parameters.
    8181     */
    82     function Hierarchy($params=array())
     82    public function __construct($params=array())
    8383    {
    8484        $this->params = $params;
     
    9292     *                      if no new ones are specified.
    9393     */
    94     function currentNode($child_type=null, $child_id=null)
     94    public function currentNode($child_type=null, $child_id=null)
    9595    {
    9696        $old_type = isset($this->child_type) ? $this->child_type : $child_type;
     
    113113     *                  otherwise if an array is provided, an array of identifiers is returned.
    114114     */
    115     function toStringID($child_type=null, $child_id=null)
     115    public function toStringID($child_type=null, $child_id=null)
    116116    {
    117117            $app =& App::getInstance();
     
    147147     * @return mixed    Array of node type and id on success, false on failure.
    148148     */
    149     function toArrayID(&$node)
     149    public function toArrayID(&$node)
    150150    {
    151151            $app =& App::getInstance();
     
    167167     * @return bool     true on success, false on error.
    168168     */
    169     function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='')
     169    public function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='')
    170170    {
    171171        $app =& App::getInstance();
     
    246246     * @return bool      false on error, true otherwise.
    247247     */
    248     function deleteNode($child_type=null, $child_id=null)
     248    public function deleteNode($child_type=null, $child_id=null)
    249249    {
    250250        $app =& App::getInstance();
     
    296296     * @return bool      false on error, true otherwise.
    297297     */
    298     function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='')
     298    public function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='')
    299299    {
    300300            $app =& App::getInstance();
     
    373373     * @return string   The parents as an array of serialized node identifiers.
    374374     */
    375     function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='')
     375    public function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='')
    376376    {
    377377        $app =& App::getInstance();
     
    424424     * @return array   type, id, title, subnode_quantity.
    425425     */
    426     function getNode($child_type=null, $child_id=null)
     426    public function getNode($child_type=null, $child_id=null)
    427427    {
    428428        $app =& App::getInstance();
     
    468468     * @return string  The children as an array of serialized node identifiers.
    469469     */
    470     function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='')
     470    public function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='')
    471471    {
    472472        $app =& App::getInstance();
     
    520520     * @return integer
    521521     */
    522     function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null)
     522    public function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null)
    523523    {
    524524        $app =& App::getInstance();
     
    561561     * @return bool      true if a leaf, or false if not or an error
    562562     */
    563     function isLeaf($child_type=null, $child_id=null)
     563    public function isLeaf($child_type=null, $child_id=null)
    564564    {
    565565        $app =& App::getInstance();
     
    595595     *                   parent, or false otherwise, or in case of failure.
    596596     */
    597     function isAncestor($child_type, $child_id, $considered_parent_type, $considered_parent_id)
     597    public function isAncestor($child_type, $child_id, $considered_parent_type, $considered_parent_id)
    598598    {
    599599        $family_tree = $this->getAllAncestors($considered_parent_type, $considered_parent_id);
     
    622622     * @return array     Array of serialized node identifiers.
    623623     */
    624     function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true)
     624    public function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true)
    625625    {
    626626        $db =& DB::getInstance();
     
    676676     * @return bool      true if a leaf, or false if not or an error
    677677     */
    678     function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null)
     678    public function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null)
    679679    {
    680680        $app =& App::getInstance();
     
    728728     *                specified node: (type, id, title, indent level, selected status)
    729729     */
    730     function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true)
     730    public function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true)
    731731    {
    732732        $app =& App::getInstance();
     
    801801     * @param  string  $type_constraint  An array of node types to restrict the search to.
    802802     */
    803     function rebuildSubnodeQty($type_constraint=null)
     803    public function rebuildSubnodeQty($type_constraint=null)
    804804    {
    805805        $db =& DB::getInstance();
     
    825825     * all parents recursively.
    826826     */
    827     function setSubnodeQtyToParents($child_type, $child_id, $num_children)
     827    public function setSubnodeQtyToParents($child_type, $child_id, $num_children)
    828828    {
    829829        $db =& DB::getInstance();
     
    848848// THE END
    849849}
    850 
    851 
    852 
    853 
    854 ?>
Note: See TracChangeset for help on using the changeset viewer.