protected function insertLevel($level, $title = '', $parent_id = 0, $config = null) { $id = $this->findEntityIdByTitle($title, $level); if ($id) { return $id; } $entity = new VF_Level($level); if (!is_null($config)) { $entity->setConfig($config); } $entity->setTitle($title); $id = $entity->save($parent_id); return $id; }