@param int $id

@return NodeReferenceInterface
486430
protected function resolveData($id)
    {
        if (!is_null($id)) {
            return $this->getDoctrine()->getRepository('ClasticAliasBundle:Alias')
                ->find($id);
        }

        return new Alias();
    }
876853
public function removeReferences($id, $data) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Skill not found.']);
		}

		// pass remove to internal logic
		try {
			$this->doRemoveReferences($model, $data);
		} catch (ErrorsException $e) {
			return new NotValid(['errors' => $e->getErrors()]);
		}

		// save and dispatch events
		$this->dispatch(SkillEvent::PRE_REFERENCES_REMOVE, $model, $data);
		$this->dispatch(SkillEvent::PRE_SAVE, $model, $data);
		$rows = $model->save();
		$this->dispatch(SkillEvent::POST_REFERENCES_REMOVE, $model, $data);
		$this->dispatch(SkillEvent::POST_SAVE, $model, $data);

		if ($rows > 0) {
			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}
27696
public function deleteNode($id)
    {
        $this->validate();
        
        $params = [
            'index' => $this->client->getIndex(),
            'type'  => $this->client->getType(),
            'id'    => $id,
        ];
        $responses = $this->client->getClient()->delete($params);
        return $responses['result'];
    }
1058385
public function getNode($id)
    {
        if (!isset($this->nodes[$id])) {
            throw new InvalidArgumentException(sprintf('There is no node with id "%s".', $id));
        }

        return $this->nodes[$id];
    }
1058379
public function removeChild(int $id): InnerNode
    {
        if ( ! isset($this->children[$id])) {
            return $this;
        }

        // handle moving next and previous assignments.
        $next = $this->children[$id]['next'];
        $prev = $this->children[$id]['prev'];
        if ( ! is_null($next)) {
            $this->children[$next]['prev'] = $prev;
        }
        if ( ! is_null($prev)) {
            $this->children[$prev]['next'] = $next;
        }

        // remove the child
        unset($this->children[$id]);

        //clear any cache
        $this->clear();

        return $this;
    }
309706
public function delete($id)
    {
        if ($this->has($id)) {
            //remove instance
            unset($this->instances[$id]);

            //remove interface reference if exists
            foreach ($this->interfaces as $int => $classes) {
                $key = array_search($id, $classes);
                if ($key !== false) {
                    unset($classes[$key]);
                    $this->interfaces[$int] = $classes;
                }
            }

            //remove instance from singleton binding
            if ($this->hasDefinition($id)) {
                $definition = $this->getDefinition($id);
                if ($definition instanceof Singleton) {
                    $definition->deleteStoredInstance();
                }
            }
        }
        return $this;
    }
684176
public function findOneById($id)
    {
        $persister = $this->entityManager->getEntityPersister($this->className);

        return $persister->loadOneById($id);
    }
161527
public function setId($id)
    {
        $this->getTabs()->each(function (TabInterface $tab) use ($id) {
            if ($tab instanceof FormInterface) {
                $tab->setId($id);
            }
        });

        return $this;
    }
925332
public function id(int $id): SectionTwigExtension
    {
        $this->throwNotFound = true;
        $this->options[ReadOptions::ID] = $id;

        return $this;
    }
1092820
protected function dereference($id): string
    {
        if ($id instanceof Reference) {
            $id = $id->getId();
        }

        if (!isset($this->definitions[$id]) || !$this->definitions[$id] instanceof Reference) {
            return $id;
        }

        if (isset($this->dereferencing[$id])) {
            throw new CircularReferenceException(sprintf(
                'Circular reference to "%s" detected while dereferencing: %s; building: %s',
                $id,
                implode(',', array_keys($this->dereferencing)),
                implode(',', array_keys($this->building))
            ));
        }

        $this->dereferencing[$id] = 1;
        $newId = $this->dereference($this->definitions[$id]->getId());
        unset($this->dereferencing[$id]);

        return $newId;
    }
510957
public function getChildren($id)
    {
        $table = $this->getTable();
        $closure = $table . '_closure';
        $tableAlias = 'c';
        $closureAlias = 'cc';
        $primaryKey = $this->mapper->getPrimaryKey($table);
        $fluent = $this->connection->command()
            ->select('%n.*', $tableAlias)
            ->from('%n AS %n', $table, $tableAlias)
            ->join('%n AS %n', $closure, $closureAlias)
            ->on('%n.%n = %n.descendant', $tableAlias, $primaryKey, $closureAlias)
            ->where('%n.ancestor = %s', $closureAlias, $id)
            ->where('%n.depth = 1', $closureAlias);

        $entityClass = $this->mapper->getEntityClass($this->getTable());
        $rc = new ReflectionClass($entityClass);
        $closureEntityClass = $entityClass . 'Closure';
        if ($rc->implementsInterface('Joseki\LeanMapper\ClosureTable\ISortable')) {
            $fluent->orderBy('%n.order', $tableAlias);
        } else if (class_exists($closureEntityClass)) {
            /** @var Entity $closureEntity */
            $closureEntity = new $closureEntityClass;
            if ($closureEntity->getReflection($this->mapper)->getEntityProperty('order')) {
                $fluent->orderBy('%n.order', $closureAlias);
            }
        }

        return $this->createEntities($fluent->fetchAll());
    }
1287857
public function setId($id)
    {
        if (!is_null($id)) {
            $id = (string) $id;
        }

        $this->id = $id;
        return $this;
    }
1107000
public function getById($id)
    {
        if ($this->id == $id) return $this;

        return $this->children->getById($id);
    }
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];
    }
523725
public function getNode(string $id): Node
	{
		if (isset($this->nodes[$id])) {
			return $this->nodes[$id];
		} else {
			throw new MissingNodeException(sprintf("Node \"%s\" not found in the graph.", $id));
		}
	}
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;
    }
617416
public function deleteNode( $id = null )
	{
		$node = $this->getNode( $id, MW_Tree_Manager_Abstract::LEVEL_ONE );

		$conn = $this->_dbm->acquire( $this->_dbname );

		try
		{
			$stmt = $conn->create( $this->_config['delete'] );
			$stmt->bind( 1, $node->left, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 2, $node->right, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->execute()->finish();

			$diff = $node->right - $node->left + 1;

			$stmt = $conn->create( $this->_config['move-left'] );
			$stmt->bind( 1, -$diff, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 2, 0, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 3, $node->right + 1, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 4, 0x7FFFFFFF, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->execute()->finish();

			$stmt = $conn->create( $this->_config['move-right'] );
			$stmt->bind( 1, -$diff, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 2, $node->right + 1, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 3, 0x7FFFFFFF, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->execute()->finish();

			$this->_dbm->release( $conn, $this->_dbname );
		}
		catch( Exception $e )
		{
			$this->_dbm->release( $conn, $this->_dbname );
			throw $e;
		}
	}