Gets descendant states

Retrieves an array of states of all stateful UI-objects in the widget
subtree below this container.

@return array an array of UI-object states with UI-object identifiers as
array keys.
511442
public function getDescendantStates()
    {
        $states = array();

        foreach ($this->getDescendants('SwatState') as $id => $object) {
            $states[$id] = $object->getState();
        }

        return $states;
    }
799680
public function getObjects($state = null)
    {
        if (!isset($state)) {
            return $this->objects;
        }

        $objectList = [];
        foreach ($this->objects as $id => $object) {
            if ($this->objectStates[$id] == $state) {
                $objectList[$id] = $object;
            }
        }

        return $objectList;
    }
803098
public function getAllowedStates()
    {
        // Get states from extending object. (ie. Page, DataObject)
        $allowedStates = $this->owner->config()->allowed_states;
        if (is_array($allowedStates) &&
            $allowedStates) {
            return $allowedStates;
        }

        // Get allowed states global. If there are no specific rules on a Page/DataObject
        // fallback to what is configured on this extension
        $allowedStates = Config::inst()->get(__CLASS__, 'allowed_states');
        if (is_array($allowedStates) &&
            $allowedStates) {
            return $allowedStates;
        }
        return [];
    }
11534
public function getComponents()
    {
        $result = [];

        foreach ($this->children as $childGroup) {
            foreach ($childGroup as $child) {
                if ($child instanceof self) {
                    $result[] = $child;
                }
            }
        }

        return $result;
    }
278096
public function getStates()
    {
        if (!is_null($this->_aStates)) {
            return $this->_aStates;
        }

        $sCountryId = $this->getId();
        $sViewName = getViewName("oxstates", $this->getLanguage());
        $sQ = "select * from {$sViewName} where `oxcountryid` = '$sCountryId' order by `oxtitle`  ";
        $this->_aStates = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
        $this->_aStates->init("oxstate");
        $this->_aStates->selectString($sQ);

        return $this->_aStates;
    }
768493
def getStates(self):
        '''
        
        '''
        self.bLvlNow = self.Rfree*self.aLvlNow
        self.mLvlNow = self.bLvlNow + self.eStateNow
935575
public function getChildren()
    {
        $children = [];
        if ($this->entity->getChildren()) {
            foreach ($this->entity->getChildren() as $child) {
                $children[] = new self($child, $this->locale);
            }
        }

        return $children;
    }
4278
private function getStateSchema(): array
    {
        return [
            "type" => "assoc" ,
            "required" => false,
            "properties" => [
                "class" => [ "type" => "fqcn", "required" => false ],
                "initial" => [
                    "type" => "bool",
                    "required" => false
                ],
                "final" => [
                    "type" => "bool",
                    "required" => false
                ],
                "interactive" => [
                    "type" => "bool",
                    "required" => false
                ],
                "output" => [
                    "type" => "assoc",
                    "required" => false,
                    "properties" => [
                        ":any_name:" => [ "type" => "any" ]
                    ]
                ],
                "input_schema" =>  [
                    "type" => "assoc",
                    "required" => false,
                    "properties" => [
                        ":any_name:" => [ "type" => "any" ]
                    ]
                ],
                "output_schema" =>  [
                    "type" => "assoc",
                    "required" => false,
                    "properties" => [
                        ":any_name:" => [ "type" => "any" ]
                    ]
                ],
                "settings" =>  [
                    "type" => "assoc",
                    "required" => false,
                    "properties" => [
                        ":any_name:" => [ "type" => "any" ]
                    ]
                ],
                "transitions" =>  [
                    "type" => "assoc",
                    "required" => true,
                    "properties" => [
                        ":any_name:" => [
                            "type" => "enum" ,
                            "required" => false,
                            "one_of" => [ "string", "&transition" ]
                        ]
                    ]
                ]
            ]
        ];
    }
891784
public function getParentsList()
    {
        /** @var static $root */
        $root  = static::root();
        $items = [
            ['id' => '1', 'title' => 'Item Root'],
        ];
        $nodes = $root->descendants();
        if ($this->exists) {
            $nodes->where('navigation_id', $this->navigation_id)->where('id', '<>', $this->id);
        }

        foreach ($nodes->get() as $node) {
            foreach ($node->getDescendantsAndSelf()->toHierarchy() as $menu) {
                $this->appendMenu($menu, $items);
            }
        }

        return array_pluck($items, 'title', 'id');
    }
253049
public function descendantFieldKeys(): array
    {
        $keys = [];

        foreach ($this->children() as $key => $node) {

            if ($node instanceof ModelFormLayoutNodeInterface) {
                $keys = array_merge($keys, $node->descendantFieldKeys());
                continue;
            }

            $keys[] = $node;
        }

        return $keys;
    }
976290
protected function getStates()
    {
        //Get the states from the JSON file
        if (sizeof($this->states) == 0) {
            $this->states = json_decode(file_get_contents(__DIR__ . '/Models/states.json'), true);
        }

        //Return the states
        return $this->states;
    }
308271
public final int[] getIndexRootsArray() {

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);
        int[] roots = new int[getIndexCount()];

        for (int i = 0; i < getIndexCount(); i++) {
            CachedObject accessor = store.getAccessor(indexList[i]);

            roots[i] = accessor == null ? -1
                                        : accessor.getPos();
        }

        return roots;
    }
345686
public function getOldAncestors()
    {
        // No need to access DB to get ancestors as they are given by the materialized path.
        $parts = preg_split('/-(\d+)'.ResourceNode::PATH_OLDSEPARATOR.'/', $this->path, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
        $ancestors = [];
        $countAncestors = count($parts);
        for ($i = 0; $i < $countAncestors; $i += 2) {
            if (array_key_exists($i + 1, $parts)) {
                $ancestors[] = [
                    'id' => (int) $parts[$i + 1],
                    'name' => $parts[$i],
                ];
            }
        }

        return $ancestors;
    }
8404
public function getDeviceStates()
    {
        $uri = 'deviceStates';
        $response = $this->client->getEndpoint()->get($uri);

        $deviceStates = [];
        foreach (\GuzzleHttp\json_decode($response->getBody()) as $deviceState) {
            $deviceStates[] = new DeviceState($this->client, $deviceState);
        }

        return $deviceStates;
    }
406705
protected function getTreeNodeStates()
    {
        $sessionStorage = $this->getEnvironment()->getSessionStorage();
        $openElements   = $sessionStorage->get($this->getToggleId());

        if (!\is_array($openElements)) {
            $openElements = [];
        }

        return new TreeNodeStates($openElements);
    }
768369
def fetch_node_manager_states
      states = {}
      @zk.children(current_state_root).each do |child|
        full_path = "#{current_state_root}/#{child}"
        begin
          states[child] = symbolize_keys(decode(@zk.get(full_path).first))
        rescue ZK::Exceptions::NoNode
          # ignore, this is an edge case that can happen when a node manager
          # process dies while fetching its state
        rescue => ex
          logger.error("Failed to fetch states for #{full_path}: #{ex.inspect}")
        end
      end
      states
    end
1296138
public function getAncestry() {
		$ancestry = array();
		$container = $this;
		while ($container instanceof ElggEntity) {
			array_unshift($ancestry, $container->guid);
			$container = $container->getContainerEntity();
		}
		return $ancestry;
	}