getPresence() публичный Метод

Returns the number of children of type $type present inside this container This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase and PMA\libraries\navigation\nodes\NodeTable classes
public getPresence ( string $type = '', string $searchClause = '' ) : integer
$type string The type of item we are looking for ('columns' or 'indexes')
$searchClause string A string used to filter the results of the query
Результат integer
Пример #1
0
 /**
  * Adds containers to a node that is a table
  *
  * References to existing children are returned
  * if this function is called twice on the same node
  *
  * @param NodeTable $table The table node, new containers will be
  *                         attached to this node
  * @param int       $pos2  The position for the pagination of
  *                         the branch at the second level of the tree
  * @param string    $type3 The type of item being paginated on
  *                         the third level of the tree
  * @param int       $pos3  The position for the pagination of
  *                         the branch at the third level of the tree
  *
  * @return array An array of new nodes
  */
 private function _addTableContainers($table, $pos2, $type3, $pos3)
 {
     $retval = array();
     if ($table->hasChildren(true) == 0) {
         if ($table->getPresence('columns')) {
             $retval['columns'] = NodeFactory::getInstance('NodeColumnContainer');
         }
         if ($table->getPresence('indexes')) {
             $retval['indexes'] = NodeFactory::getInstance('NodeIndexContainer');
         }
         if ($table->getPresence('triggers')) {
             $retval['triggers'] = NodeFactory::getInstance('NodeTriggerContainer');
         }
         // Add all new Nodes to the tree
         foreach ($retval as $node) {
             $node->pos2 = $pos2;
             if ($type3 == $node->real_name) {
                 $node->pos3 = $pos3;
             }
             $table->addChild($node);
         }
     } else {
         foreach ($table->children as $node) {
             if ($type3 == $node->real_name) {
                 $node->pos3 = $pos3;
             }
             $retval[$node->real_name] = $node;
         }
     }
     return $retval;
 }