返回直接子级，一维数组
@param int $id
@return array|null
169487
public function children($id = null)
    {
        $id = ($id == null) ? $this->root : $id;
        foreach ($this->data as $v) {
            if ($v[$this->fields[1]] == $id) {
                $result[$v[$this->fields[0]]] = $v;
            }
        }
        return isset($result) ? $result : null;
    }
959874
public static function node($id)
    {
        $id = intval($id);
        if (empty($id)) return null;
        
        if (!static::$caching || empty(static::$_nodes[$id])) {
            $result = static::findOne($id);
            if (static::$caching) {
                static::$_nodes[$id] = $result;
            } else {
                return $result;
            }
        }
        return static::$_nodes[$id];
    }
879018
public function getResult($id)
    {
        return isset($this->results[$id]) ? $this->results[$id] : null;
    }
1273171
public function getParameterByID($id)
    {
        $param = current(array_filter($this->params, function (Param $param) use ($id) {
            return ($param->id === $id);
        }));

        return ($param) ? $param : null;
    }
1076622
public function getLoadedModel($id)
    {
        return isset($this->_loadModels[$id]) ? $this->_loadModels[$id] : null;
    }
844203
public function findParentNodesByChildId($id)
	{
        // To be returned
        $result = array();

        $rl = $this->getRelations();
        $data = $rl[RelationBuilder::TREE_PARAM_ITEMS];

        // If can't find, then return empty array
        if (!isset($data[$id])) {
            return array();
        }

        $current = $data[$id];
        $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

        while (isset($data[$parentId])) {
            $current = $data[$parentId];
            $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

            array_push($result, $current);
        }

        return $result;
    }
936594
public static function get($id)
    {
        /** @var Entity $entity */
        $entity = new static();
        Manager::getInstance()->get($entity)->refreshRelations();
        $className = $entity->getClassName();
        $sql = Sql::createSql($entity->getAdapter())
            ->select($entity->getTableName())
            ->where(
                [
                    "{$entity->getTableName()}.{$entity->_primaryKey} = :id" =>
                        [
                            ':id' => $id
                        ]
                ]
            );
        $events = $entity->getEventManager();
        $event = new Select([
            'sqlQuery' => $sql,
            'params' => compact('id'),
            'action' => Select::GET,
            'singleItem' => true
        ]);
        $events->trigger(Select::BEFORE_SELECT, $entity, $event);
        $row = $event->sqlQuery->first();

        if ($row) {
            $event->data = $row;
            $events->trigger(Select::AFTER_SELECT, $entity, $event);
            $object = new $className($event->data);
            return $object;
        }
        return null;
    }
472114
public function find($id)
    {
        foreach ($this->locked as $attributes) {
            if ($attributes['id'] == $id) {
                return $attributes;
            }
        }

        foreach ($this->failed as $attributes) {
            if ($attributes['id'] == $id) {
                return $attributes;
            }
        }

        foreach ($this->queue as $attributes) {
            if ($attributes['id'] == $id) {
                return $attributes;
            }
        }

    }
540146
private function getFirstValue($id)
    {
        if ($this->properties === null) {
            return null;
        }
        $properties = $this->properties->getProperties();

        if (isset($properties[$id])) {
            return $properties[$id]->getFirstValue();
        }

        return null;
    }
1119835
public function find($id)
    {
        $this->newQuery();

        $this->queryBuilder->whereEqual($this->primaryFieldName, $id);

        $queryKey = $this->queryBuilder->firstQueryKey();

        if (!$this->isCompleteKey($queryKey)) {
            return null;
        }

        list($method, $parameters) = $this->getFindMethodAndParameters();

        array_unshift($parameters, $queryKey);
        $value = call_user_func_array([$this->redClient, $method], $parameters);

        return $value;
    }
764172
public function findById($id)
    {
        $rowset = $this->getTableGateway()->select(function (Select $select) use($id) {
            $select->columns($this->columns)
            ->where(array(
                'id' => $id
            ))
            ->limit(1);
        });
        $row = $rowset->current();
        if (! $row) {
            return NULL;
        }
        return $row;
    }
1009630
public function getRootItem($id)
    {
        return isset($this->menuRootItems[$id]) ? $this->menuRootItems[$id] : null;
    }
895002
public function get($id)
    {
        foreach ($this->children as $child) {
            if ($id === $child->getId()) {
                return $child;
            }
        }
    }
918948
public function getItem($id)
    {
        foreach ($this->items as $item) {
            if ($item->getId() == $id) {
                return ($item);
            }
        }

        return null;
    }
590268
public function get($id)
    {
        foreach ($this->items as $item) {
            if ($item->id === $id) {
                return $item;
            }
        }
        return null;
    }
23307
public function removeChildById($id)
	{
		if(isset($this->id2index[$id]))
		{
			$tmp = $this->children[$this->id2index[$id]];
			if(isset($tmp->name))
				unset($this->name2index[$tmp->name]);
			unset($this->children[$this->id2index[$id]], $this->id2index[$id]);
			return $tmp;
		}
		return null;
	}
1206162
public function getChild(string $id)
    {
        $menuItem = $this->menuItem->getChild($id);

        return $menuItem ? $this->generateMenuItem($menuItem) : null;
    }