public function nodeAttributes($model = false, $pid = '', $uniqueKey = false)
    {
        $uniqueKey = $uniqueKey ? $uniqueKey : self::$uniqueKey++;
        $model     = ($model) ? $model : $this->owner;
        $id        = $model[$this->id];
        $nodeId    = $uniqueKey . '-id-' . $id;

        return array(
            'id'       => $nodeId,
            'model'    => $model,
            'children' => $model[$this->childrenAttribute],
            'text'     => $model['name'],
            'type'     => $model['type'] == 1 ? 'user' : 'flag',
            'selected' => in_array($model[$this->id], $this->selectedNodes),
            'a_attr'   => array(
                'class'   => 'jstree-clicked',
                'data-id' => $nodeId,
                'href'      => [$this->actionPath, $this->id => $id, 'pid'=> $pid]
            )
        );
    }