original_string: public function getChildOrganizations($parentId = null)
      {
          static $children;
  
          if (is_null($parentId)) {
              return array();
          }
  
          if (! isset($children[$parentId])) {
              $organizations = $this->db->fetchPairs(
                      'SELECT gor_id_organization, gor_name
                          FROM gems__organizations
                          WHERE gor_active=1 AND gor_has_login=1 AND
                              (gor_accessible_by LIKE ' . $this->db->quote('%:' . $parentId . ':%') . ' OR
                                  gor_id_organization = ' . $this->db->quote($parentId) .  ')
                              ORDER BY gor_name');
  
              natsort($organizations);
  
              $children[$parentId] = $organizations;
          }
  
          return $children[$parentId];
      }
code: public function getChildOrganizations($parentId = null)
      {
          static $children;
  
          if (is_null($parentId)) {
              return array();
          }
  
          if (! isset($children[$parentId])) {
              $organizations = $this->db->fetchPairs(
                      'SELECT gor_id_organization, gor_name
                          FROM gems__organizations
                          WHERE gor_active=1 AND gor_has_login=1 AND
                              (gor_accessible_by LIKE ' . $this->db->quote('%:' . $parentId . ':%') . ' OR
                                  gor_id_organization = ' . $this->db->quote($parentId) .  ')
                              ORDER BY gor_name');
  
              natsort($organizations);
  
              $children[$parentId] = $organizations;
          }
  
          return $children[$parentId];
      }
code_tokens: public function getChildOrganizations ( $ parentId = null ) { static $ children ; if ( is_null ( $ parentId ) ) { return array ( ) ; } if ( ! isset ( $ children [ $ parentId ] ) ) { $ organizations = $ this -> db -> fetchPairs ( 'SELECT gor_id_organization, gor_name
                          FROM gems__organizations
                          WHERE gor_active=1 AND gor_has_login=1 AND
                              (gor_accessible_by LIKE ' . $ this -> db -> quote ( '%:' . $ parentId . ':%' ) . ' OR
                                  gor_id_organization = ' . $ this -> db -> quote ( $ parentId ) . ')
                              ORDER BY gor_name' ) ; natsort ( $ organizations ) ; $ children [ $ parentId ] = $ organizations ; } return $ children [ $ parentId ] ; }
docstring: Return array of organizations that are a child of the given parentId
  
  @param int $parentId
  @return array
docstring_tokens: Return array of organizations that are a child of the given parentId