public function sort($order, $head = true)
    {
        $list = array();

        settype($order, 'array');

        $order = array_unique($order);

        foreach ($order as $item) {
            if (isset($this->_objects[$item])) {
                $list[$item] = $this->_objects[$item];
            }
        }

        foreach ($this->_objects as $key => $object) {
            if (isset($list[$key])) {
                unset($this->_objects[$key]);
            }
        }

        if ($head) {
            $objects = array_merge($list, $this->_objects);
        } else {
            $objects = array_merge($this->_objects, $list);
        }

        $this->_objects = $objects;

        return $this;
    }