コード例 #1
0
}
require_once $autoload_location;
require_once __DIR__ . '/../conf/config.php';
require_once __DIR__ . '/../conf/bootstrap.php';
use Omatech\Editora\Extractor\Extractor;
$params = ['ids' => '(784, 787, 100104)', 'lang' => 'ca', 'debug' => false, 'metadata' => true];
$query = 'query FetchListQuery ($ids:String, $lang:String, $debug:Boolean) {
  instances_list (ids: $ids, lang: $lang, debug: $debug) 
	{
	  instances 
		{
				id nom_intern link publishing_begins status update_timestamp
				all_values (filter: "fields:title"){atri_tag text_val}				
		}
  }
}';
$extractor = new Extractor($conn);
$res = $extractor->extract($query, $params);
if ($params['debug']) {
    echo "DEBUG\n";
    echo $extractor->debug_messages;
}
if ($res) {
    echo "HA FUNCIONAT!!!";
    print_r($res);
}
$res = $extractor->extract($query, $params, "json");
if ($res) {
    echo "HA FUNCIONAT!!!";
    echo $res;
}
コード例 #2
0
require_once $autoload_location;
require_once __DIR__ . '/../conf/config.php';
require_once __DIR__ . '/../conf/bootstrap.php';
use Omatech\Editora\Extractor\Extractor;
$params = ['query' => 'Brossa', 'lang' => 'ca', 'preview' => true, 'debug' => true, 'metadata' => true];
$query = 'query FetchSearchQuery ($query:String, $class_id:Int, $lang:String, $debug:Boolean, $preview:Boolean) 
{
  search(query: $query, class_id: $class_id, lang: $lang, debug: $debug, preview:$preview) 
	{
		instances
		{
				id nom_intern link publishing_begins status creation_date class_name class_tag class_id update_timestamp
				all_values (filter: "fields:title|subtitle"){atri_tag text_val}				
		}
  }
}';
$extractor = new Extractor($conn);
$res = $extractor->extract($query, $params, 'array', false);
if ($params['debug']) {
    echo "DEBUG\n";
    echo $extractor->debug_messages;
}
if ($res) {
    echo "HA FUNCIONAT!!!";
    print_r($res);
}
$res = $extractor->extract($query, $params, "json");
if ($res) {
    echo "HA FUNCIONAT!!!";
    echo $res;
}
コード例 #3
0
ファイル: launch2.php プロジェクト: omatech/editora-extractor
		instances
		{
				id nom_intern link publishing_begins status creation_date class_name class_tag class_id update_timestamp
				all_values (lang: $lang) {atri_tag text_val}
				
        relation1 (lang: $lang, debug: $debug, tag: "pages", limit:10)
				{
						id tag direction limit
						instances {
								id nom_intern link publishing_begins status creation_date class_name class_tag class_id update_timestamp
								all_values (lang: $lang, filter: "fields:title|niceurl") {atri_tag text_val}
						}
				}
		}
  }
}';
$extractor = new Extractor($conn);
$res = $extractor->extract($query, $params);
if ($params['debug']) {
    echo "DEBUG\n";
    echo $extractor->debug_messages;
}
if ($res) {
    echo "HA FUNCIONAT!!!";
    print_r($res);
}
foreach ($res['instances'] as $element) {
    if (isset($element['title'])) {
        echo $element['title'] . "\n";
    }
}
コード例 #4
0
$query = 'query FetchHomeQuery ($id:Int, $lang:String, $debug:Boolean) {
				instance(id: $id, lang: $lang, debug: $debug) {
						id nom_intern link class_id
						all_values {atri_tag text_val}
		
					relation1 (tag: "obra_temporada"){
						id tag direction limit
						instances {id nom_intern link class_id all_values {atri_tag text_val}
							relation1 (tag: "obra_filtro"){
								id tag direction limit
								instances {id nom_intern link class_id all_values {atri_tag text_val}
								}
							}
						}
					}
					relation2 (tag: "temporada_filtro"){
						id tag direction limit
						instances {id nom_intern link class_id all_values {atri_tag text_val}
						}
					}
				}
			}';
$extractor = new Extractor($conn);
$instance = $extractor->extract($query, $params, 'array', true);
if ($params['debug']) {
    echo "DEBUG\n";
    echo $extractor->debug_messages;
}
echo '<pre>';
print_r($instance);
echo '</pre>';
コード例 #5
0
require_once __DIR__ . '/../conf/bootstrap.php';
use Omatech\Editora\Extractor\Extractor;
$params = ['class_id' => '80', 'lang' => 'ca', 'preview' => true, 'debug' => false, 'metadata' => true];
$show_metadata = true;
$query = 'query FetchClassQuery ($class_id:Int, $lang:String, $debug:Boolean, $preview:Boolean) 
  {
  class(class_id: $class_id, lang: $lang, debug: $debug, preview:$preview, limit:3) 
	{
    class_id tag
		instances
		{
				id nom_intern link publishing_begins status creation_date class_name class_tag class_id update_timestamp
				all_values {atri_tag text_val}
				relation1 (tag: "obra_actividad")
				{
				  id tag direction limit
					instances {id nom_intern link class_id all_values {atri_tag text_val num_val}}
				}
		}
  }
}';
$extractor = new Extractor($conn);
$res = $extractor->extract($query, $params, 'array', true);
if ($params['debug']) {
    echo "DEBUG\n";
    echo $extractor->debug_messages;
}
if ($res) {
    echo "HA FUNCIONAT!!!";
    print_r($res);
}