Exemplo n.º 1
0
<?php

require_once '../vendor/autoload.php';
require_once '../generated-conf/config.php';
require_once '../app/functions/functions.php';
$root_topic = TopicQuery::create()->findRoot();
if (!$root_topic) {
    $root_topic = new Topic();
    $root_topic->setName('Topics')->makeRoot()->save();
}
Exemplo n.º 2
0
function getTopicsDatas($topics_ids = [])
{
    $topics_objects = TopicQuery::create()->_if(count($topics_ids))->filterByPrimaryKeys($topics_ids)->_endif()->find();
    $topics_datas = [];
    foreach ($topics_objects as $topic_object) {
        $topics_datas[$topic_object->getId()] = $topic_object->toArray();
    }
    return $topics_datas;
}