public
Created

  • Download Gist
gistfile1.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
<?php
public function getFeedMapping()
{
$type = Zend_Uri::factory('http://purl.org/ontology/po/Programme');
$image_uri = Zend_Uri::factory($this->image->getUrl(512, 288));
if ($this->display_buzz) {
$hash_tags = $this->hash_tags;
$articles = $this->articles;
$discussions = $this->discussions;
} else {
$hash_tags = null;
$articles = null;
$discussions = null;
}
if (!empty($this->products)) {
$products = array_slice($this->products, 0, 2);
} else {
$products = array();
}
return array(
'urimap' => array(
'this' => '/programmes/' . $this->pid . '#programme',
'brand' => 'http://purl.org/ontology/po/Brand',
'series' => 'http://purl.org/ontology/po/Series',
'episode' => 'http://purl.org/ontology/po/Episode',
'clip' => 'http://purl.org/ontology/po/Clip',
),
'entity' => 'programme',
'@rdf:type' => array($type, $this->type),
'po:pid' => $this->pid,
'po:position' => $this->position,
'dc:title' => $this->title,
'po:short_synopsis' => $this->short_synopsis,
'po:medium_synopsis' => $this->medium_synopsis,
'po:long_synopsis' => $this->long_synopsis,
'po:duration' => $this->play_version_duration,
'po:display_titles' => $this->display_titles,
'foaf:depiction' => $image_uri,
'po:ownership!' => $this->service,
'po:expected_child_count' => $this->expected_child_count,
'[po:genre/genres]' => $this->genres,
'[po:format/formats]' => $this->formats,
'[po:version/versions]'=> $this->versions,
'po:parent' => $this->parent,
'po:available_until' => $this->available_until,
'[po:hash_tag/hash_tags]' => $hash_tags,
'[foaf:page/articles]' => $articles,
'[foaf:page/discussions]' => $discussions,
// Disabling products for now - need to make better
// use of good relations
// '[po:product/products]' => $products,
'[po:credit/credits]' => $this->contributors,
);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.