mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 20:13:28 +00:00
Rebased, fixed codestyle
This commit is contained in:
@@ -22,7 +22,6 @@ use Silex\ControllerProviderInterface;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Controller\Prod;
|
namespace Alchemy\Phrasea\Controller\Prod;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Feed\Aggregate;
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Exception\SessionNotFound;
|
use Alchemy\Phrasea\Exception\SessionNotFound;
|
||||||
use Silex\Application as SilexApplication;
|
use Silex\Application as SilexApplication;
|
||||||
|
@@ -13,7 +13,6 @@ namespace Alchemy\Phrasea\Controller\Root;
|
|||||||
|
|
||||||
use Entities\Feed;
|
use Entities\Feed;
|
||||||
use Alchemy\Phrasea\Feed\Aggregate;
|
use Alchemy\Phrasea\Feed\Aggregate;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Silex\ControllerProviderInterface;
|
use Silex\ControllerProviderInterface;
|
||||||
|
|
||||||
@@ -111,7 +110,6 @@ class RSSFeeds implements ControllerProviderInterface
|
|||||||
$page = (int) $request->query->get('page');
|
$page = (int) $request->query->get('page');
|
||||||
$page = $page < 1 ? 1 : $page;
|
$page = $page < 1 ? 1 : $page;
|
||||||
|
|
||||||
|
|
||||||
return $app['feed.formatter-strategy']('cooliris')->createResponse($feed, $page, null, 'Phraseanet', $app);
|
return $app['feed.formatter-strategy']('cooliris')->createResponse($feed, $page, null, 'Phraseanet', $app);
|
||||||
})
|
})
|
||||||
->bind('feed_public_cooliris');
|
->bind('feed_public_cooliris');
|
||||||
|
@@ -34,6 +34,7 @@ class FeedServiceProvider implements ServiceProviderInterface
|
|||||||
$collection = new LinkGeneratorCollection();
|
$collection = new LinkGeneratorCollection();
|
||||||
$collection->pushGenerator($app['feed.user-link-generator']);
|
$collection->pushGenerator($app['feed.user-link-generator']);
|
||||||
$collection->pushGenerator($app['feed.aggregate-link-generator']);
|
$collection->pushGenerator($app['feed.aggregate-link-generator']);
|
||||||
|
|
||||||
return $collection;
|
return $collection;
|
||||||
});
|
});
|
||||||
$app['feed.rss-formatter'] = $app->share(function($app) {
|
$app['feed.rss-formatter'] = $app->share(function($app) {
|
||||||
|
@@ -83,6 +83,7 @@ class Aggregate implements FeedInterface
|
|||||||
if (count($this->feeds) == 0) {
|
if (count($this->feeds) == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->em->getRepository('Entities\FeedEntry')->findByFeeds($this->feeds, $offset_start, $how_many);
|
return $this->em->getRepository('Entities\FeedEntry')->findByFeeds($this->feeds, $offset_start, $how_many);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,6 +132,7 @@ class Aggregate implements FeedInterface
|
|||||||
if (count($this->feeds) > 0) {
|
if (count($this->feeds) > 0) {
|
||||||
return count($this->em->getRepository('Entities\FeedEntry')->findByFeeds($this->feeds));
|
return count($this->em->getRepository('Entities\FeedEntry')->findByFeeds($this->feeds));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Feed;
|
namespace Alchemy\Phrasea\Feed;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FeedToken
|
* FeedToken
|
||||||
*/
|
*/
|
||||||
@@ -24,7 +22,6 @@ class AggregateToken
|
|||||||
*/
|
*/
|
||||||
private $feed;
|
private $feed;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
*
|
*
|
||||||
@@ -38,7 +35,7 @@ class AggregateToken
|
|||||||
/**
|
/**
|
||||||
* Set usr_id
|
* Set usr_id
|
||||||
*
|
*
|
||||||
* @param integer $usrId
|
* @param integer $usrId
|
||||||
* @return FeedToken
|
* @return FeedToken
|
||||||
*/
|
*/
|
||||||
public function setUsrId($usrId)
|
public function setUsrId($usrId)
|
||||||
@@ -61,7 +58,7 @@ class AggregateToken
|
|||||||
/**
|
/**
|
||||||
* Set feed
|
* Set feed
|
||||||
*
|
*
|
||||||
* @param \Entities\Feed $feed
|
* @param \Entities\Feed $feed
|
||||||
* @return FeedToken
|
* @return FeedToken
|
||||||
*/
|
*/
|
||||||
public function setFeed(\Entities\Feed $feed = null)
|
public function setFeed(\Entities\Feed $feed = null)
|
||||||
@@ -85,11 +82,10 @@ class AggregateToken
|
|||||||
*/
|
*/
|
||||||
private $value;
|
private $value;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set value
|
* Set value
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @return FeedToken
|
* @return FeedToken
|
||||||
*/
|
*/
|
||||||
public function setValue($value)
|
public function setValue($value)
|
||||||
|
@@ -32,6 +32,7 @@ class AtomFormatter extends FeedFormatterAbstract implements FeedFormatterInterf
|
|||||||
$content = $this->format($feed, $page, $user, $generator);
|
$content = $this->format($feed, $page, $user, $generator);
|
||||||
$response = new Response($content, 200, array('Content-Type' => 'application/atom+xml'));
|
$response = new Response($content, 200, array('Content-Type' => 'application/atom+xml'));
|
||||||
$response->setCharset('UTF-8');
|
$response->setCharset('UTF-8');
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,8 +77,7 @@ class AtomFormatter extends FeedFormatterAbstract implements FeedFormatterInterf
|
|||||||
|
|
||||||
if (null !== $user) {
|
if (null !== $user) {
|
||||||
$feedlink = $this->linkGenerator->generate($feed, $user, static::FORMAT, $page);
|
$feedlink = $this->linkGenerator->generate($feed, $user, static::FORMAT, $page);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$feedlink = $this->linkGenerator->generatePublic($feed, static::FORMAT, $page);
|
$feedlink = $this->linkGenerator->generatePublic($feed, static::FORMAT, $page);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,4 +156,3 @@ class AtomFormatter extends FeedFormatterAbstract implements FeedFormatterInterf
|
|||||||
return $entry_node;
|
return $entry_node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@ class CoolirisFormatter extends FeedFormatterAbstract implements FeedFormatterIn
|
|||||||
$content = $this->format($feed, $page, $user, $generator, $app);
|
$content = $this->format($feed, $page, $user, $generator, $app);
|
||||||
$response = new Response($content, 200, array('Content-Type' => 'application/rss+xml'));
|
$response = new Response($content, 200, array('Content-Type' => 'application/rss+xml'));
|
||||||
$response->setCharset('UTF-8');
|
$response->setCharset('UTF-8');
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,8 +62,7 @@ class CoolirisFormatter extends FeedFormatterAbstract implements FeedFormatterIn
|
|||||||
|
|
||||||
if (null !== $user) {
|
if (null !== $user) {
|
||||||
$link = $this->linkGenerator->generate($feed, $user, static::FORMAT, $page);
|
$link = $this->linkGenerator->generate($feed, $user, static::FORMAT, $page);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$link = $this->linkGenerator->generatePublic($feed, static::FORMAT, $page);
|
$link = $this->linkGenerator->generatePublic($feed, static::FORMAT, $page);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,4 +265,3 @@ class CoolirisFormatter extends FeedFormatterAbstract implements FeedFormatterIn
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,9 +38,9 @@ abstract class FeedFormatterAbstract
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param DOMDocument $document
|
* @param DOMDocument $document
|
||||||
* @param DOMNode $item
|
* @param DOMNode $item
|
||||||
* @param FeedItem $content
|
* @param FeedItem $content
|
||||||
* @return FeedFormaterInterface
|
* @return FeedFormaterInterface
|
||||||
*/
|
*/
|
||||||
protected function addContent(Application $app, \DOMDocument $document, \DOMNode $item, FeedItem $content)
|
protected function addContent(Application $app, \DOMDocument $document, \DOMNode $item, FeedItem $content)
|
||||||
|
@@ -10,9 +10,9 @@ interface FeedFormatterInterface
|
|||||||
* Returns a string representation of the feed
|
* Returns a string representation of the feed
|
||||||
*
|
*
|
||||||
* @param FeedInterface $feed
|
* @param FeedInterface $feed
|
||||||
* @param type $page
|
* @param type $page
|
||||||
* @param \User_Adapter $user
|
* @param \User_Adapter $user
|
||||||
* @param type $generator
|
* @param type $generator
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@@ -34,6 +34,7 @@ class RssFormatter extends FeedFormatterAbstract implements FeedFormatterInterfa
|
|||||||
$content = $this->format($feed, $page, $user, $generator);
|
$content = $this->format($feed, $page, $user, $generator);
|
||||||
$response = new Response($content, 200, array('Content-Type' => 'application/rss+xml'));
|
$response = new Response($content, 200, array('Content-Type' => 'application/rss+xml'));
|
||||||
$response->setCharset('UTF-8');
|
$response->setCharset('UTF-8');
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +65,7 @@ class RssFormatter extends FeedFormatterAbstract implements FeedFormatterInterfa
|
|||||||
|
|
||||||
if (null !== $user) {
|
if (null !== $user) {
|
||||||
$link = $this->linkGenerator->generate($feed, $user, static::FORMAT, $page);
|
$link = $this->linkGenerator->generate($feed, $user, static::FORMAT, $page);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$link = $this->linkGenerator->generatePublic($feed, static::FORMAT, $page);
|
$link = $this->linkGenerator->generatePublic($feed, static::FORMAT, $page);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,4 +203,3 @@ class RssFormatter extends FeedFormatterAbstract implements FeedFormatterInterfa
|
|||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,6 +38,7 @@ class AggregateLinkGenerator implements LinkGeneratorInterface
|
|||||||
if (null !== $page) {
|
if (null !== $page) {
|
||||||
$params['page'] = $page;
|
$params['page'] = $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new FeedLink(
|
return new FeedLink(
|
||||||
$this->generator->generate('feed_user_aggregated', $params, UrlGenerator::ABSOLUTE_URL),
|
$this->generator->generate('feed_user_aggregated', $params, UrlGenerator::ABSOLUTE_URL),
|
||||||
sprintf('%s - %s', $aggregate->getTitle(), 'Atom'),
|
sprintf('%s - %s', $aggregate->getTitle(), 'Atom'),
|
||||||
@@ -50,6 +51,7 @@ class AggregateLinkGenerator implements LinkGeneratorInterface
|
|||||||
if (null !== $page) {
|
if (null !== $page) {
|
||||||
$params['page'] = $page;
|
$params['page'] = $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new FeedLink(
|
return new FeedLink(
|
||||||
$this->generator->generate('feed_user_aggregated', $params, UrlGenerator::ABSOLUTE_URL),
|
$this->generator->generate('feed_user_aggregated', $params, UrlGenerator::ABSOLUTE_URL),
|
||||||
sprintf('%s - %s', $aggregate->getTitle(), 'RSS'),
|
sprintf('%s - %s', $aggregate->getTitle(), 'RSS'),
|
||||||
@@ -78,6 +80,7 @@ class AggregateLinkGenerator implements LinkGeneratorInterface
|
|||||||
if (null !== $page) {
|
if (null !== $page) {
|
||||||
$params['page'] = $page;
|
$params['page'] = $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new FeedLink(
|
return new FeedLink(
|
||||||
$this->generator->generate('feed_public_aggregated', $params, UrlGenerator::ABSOLUTE_URL),
|
$this->generator->generate('feed_public_aggregated', $params, UrlGenerator::ABSOLUTE_URL),
|
||||||
sprintf('%s - %s', $aggregate->getTitle(), 'Atom'),
|
sprintf('%s - %s', $aggregate->getTitle(), 'Atom'),
|
||||||
@@ -89,6 +92,7 @@ class AggregateLinkGenerator implements LinkGeneratorInterface
|
|||||||
if (null !== $page) {
|
if (null !== $page) {
|
||||||
$params['page'] = $page;
|
$params['page'] = $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new FeedLink(
|
return new FeedLink(
|
||||||
$this->generator->generate('feed_public_aggregated', $params, UrlGenerator::ABSOLUTE_URL),
|
$this->generator->generate('feed_public_aggregated', $params, UrlGenerator::ABSOLUTE_URL),
|
||||||
sprintf('%s - %s', $aggregate->getTitle(), 'RSS'),
|
sprintf('%s - %s', $aggregate->getTitle(), 'RSS'),
|
||||||
|
@@ -29,9 +29,9 @@ class FeedLink implements FeedLinkInterface
|
|||||||
protected $uri;
|
protected $uri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $uri
|
* @param string $uri
|
||||||
* @param string $title
|
* @param string $title
|
||||||
* @param string $mimetype
|
* @param string $mimetype
|
||||||
*
|
*
|
||||||
* @return FeedLink
|
* @return FeedLink
|
||||||
*/
|
*/
|
||||||
|
@@ -62,6 +62,7 @@ class FeedLinkGenerator implements LinkGeneratorInterface
|
|||||||
if (null !== $page) {
|
if (null !== $page) {
|
||||||
$params['page'] = $page;
|
$params['page'] = $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new FeedLink(
|
return new FeedLink(
|
||||||
$this->generator->generate('feed_user', $params, UrlGenerator::ABSOLUTE_URL),
|
$this->generator->generate('feed_user', $params, UrlGenerator::ABSOLUTE_URL),
|
||||||
sprintf('%s - %s', $feed->getTitle(), 'RSS'),
|
sprintf('%s - %s', $feed->getTitle(), 'RSS'),
|
||||||
|
@@ -9,10 +9,10 @@ interface LinkGeneratorInterface
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param \Alchemy\Phrasea\Feed\FeedInterface $feed
|
* @param \Alchemy\Phrasea\Feed\FeedInterface $feed
|
||||||
* @param \User_Adapter $user
|
* @param \User_Adapter $user
|
||||||
* @param type $format
|
* @param type $format
|
||||||
* @param type $page
|
* @param type $page
|
||||||
* @param type $renew
|
* @param type $renew
|
||||||
*
|
*
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
@@ -21,8 +21,8 @@ interface LinkGeneratorInterface
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param \Alchemy\Phrasea\Feed\FeedInterface $feed
|
* @param \Alchemy\Phrasea\Feed\FeedInterface $feed
|
||||||
* @param type $format
|
* @param type $format
|
||||||
* @param type $page
|
* @param type $page
|
||||||
*
|
*
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
|
@@ -17,7 +17,7 @@ namespace Alchemy\Phrasea\Feed\RSS;
|
|||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||||
* @link www.phraseanet.com
|
* @link www.phraseanet.com
|
||||||
*/
|
*/
|
||||||
class FeedRSSImage implements FeedRSSImageInterface
|
class Image implements FeedRSSImageInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -57,9 +57,9 @@ class FeedRSSImage implements FeedRSSImageInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param string $url
|
* @param string $url
|
||||||
* @param string $title
|
* @param string $title
|
||||||
* @param string $link
|
* @param string $link
|
||||||
* @return FeedRSSImage
|
* @return FeedRSSImage
|
||||||
*/
|
*/
|
||||||
public function __construct($url, $title, $link)
|
public function __construct($url, $title, $link)
|
||||||
@@ -73,7 +73,7 @@ class FeedRSSImage implements FeedRSSImageInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param type $description
|
* @param type $description
|
||||||
* @return FeedRSSImage
|
* @return FeedRSSImage
|
||||||
*/
|
*/
|
||||||
public function setDescription($description)
|
public function setDescription($description)
|
||||||
@@ -85,7 +85,7 @@ class FeedRSSImage implements FeedRSSImageInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param int $width
|
* @param int $width
|
||||||
* @return FeedRSSImage
|
* @return FeedRSSImage
|
||||||
*/
|
*/
|
||||||
public function setWidth($width)
|
public function setWidth($width)
|
||||||
@@ -97,7 +97,7 @@ class FeedRSSImage implements FeedRSSImageInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param int $height
|
* @param int $height
|
||||||
* @return FeedRSSImage
|
* @return FeedRSSImage
|
||||||
*/
|
*/
|
||||||
public function setHeight($height)
|
public function setHeight($height)
|
||||||
|
@@ -17,7 +17,7 @@ namespace Alchemy\Phrasea\Feed\RSS;
|
|||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||||
* @link www.phraseanet.com
|
* @link www.phraseanet.com
|
||||||
*/
|
*/
|
||||||
interface FeedXMLRSSImageInterface
|
interface ImageInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct($url, $title, $link);
|
public function __construct($url, $title, $link);
|
||||||
|
@@ -132,7 +132,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Add an entry to index
|
* Add an entry to index
|
||||||
*
|
*
|
||||||
* @param FeedEntry $entry
|
* @param FeedEntry $entry
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -141,7 +141,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Remove an entry to index
|
* Remove an entry to index
|
||||||
*
|
*
|
||||||
* @param FeedEntry $entry
|
* @param FeedEntry $entry
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -150,7 +150,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Update an entry in the index
|
* Update an entry in the index
|
||||||
*
|
*
|
||||||
* @param FeedEntry $entry
|
* @param FeedEntry $entry
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Entities;
|
namespace Entities;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AggregateToken
|
* AggregateToken
|
||||||
*/
|
*/
|
||||||
@@ -24,11 +22,10 @@ class AggregateToken
|
|||||||
*/
|
*/
|
||||||
private $value;
|
private $value;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
@@ -38,20 +35,20 @@ class AggregateToken
|
|||||||
/**
|
/**
|
||||||
* Set usr_id
|
* Set usr_id
|
||||||
*
|
*
|
||||||
* @param integer $usrId
|
* @param integer $usrId
|
||||||
* @return AggregateToken
|
* @return AggregateToken
|
||||||
*/
|
*/
|
||||||
public function setUsrId($usrId)
|
public function setUsrId($usrId)
|
||||||
{
|
{
|
||||||
$this->usr_id = $usrId;
|
$this->usr_id = $usrId;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get usr_id
|
* Get usr_id
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getUsrId()
|
public function getUsrId()
|
||||||
{
|
{
|
||||||
@@ -61,23 +58,23 @@ class AggregateToken
|
|||||||
/**
|
/**
|
||||||
* Set value
|
* Set value
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @return AggregateToken
|
* @return AggregateToken
|
||||||
*/
|
*/
|
||||||
public function setValue($value)
|
public function setValue($value)
|
||||||
{
|
{
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get value
|
* Get value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getValue()
|
public function getValue()
|
||||||
{
|
{
|
||||||
return $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,6 @@ namespace Entities;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Feed\FeedInterface;
|
use Alchemy\Phrasea\Feed\FeedInterface;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Feed
|
* Feed
|
||||||
@@ -88,7 +87,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Set public
|
* Set public
|
||||||
*
|
*
|
||||||
* @param boolean $public
|
* @param boolean $public
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function setIsPublic($public)
|
public function setIsPublic($public)
|
||||||
@@ -111,7 +110,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Set icon_url
|
* Set icon_url
|
||||||
*
|
*
|
||||||
* @param boolean $iconUrl
|
* @param boolean $iconUrl
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function setIconUrl($iconUrl)
|
public function setIconUrl($iconUrl)
|
||||||
@@ -134,7 +133,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Set base_id
|
* Set base_id
|
||||||
*
|
*
|
||||||
* @param integer $baseId
|
* @param integer $baseId
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function setBaseId($baseId)
|
public function setBaseId($baseId)
|
||||||
@@ -157,7 +156,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Set title
|
* Set title
|
||||||
*
|
*
|
||||||
* @param string $title
|
* @param string $title
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function setTitle($title)
|
public function setTitle($title)
|
||||||
@@ -180,7 +179,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Add publishers
|
* Add publishers
|
||||||
*
|
*
|
||||||
* @param \Entities\FeedPublisher $publishers
|
* @param \Entities\FeedPublisher $publishers
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function addPublisher(\Entities\FeedPublisher $publishers)
|
public function addPublisher(\Entities\FeedPublisher $publishers)
|
||||||
@@ -213,7 +212,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Add entries
|
* Add entries
|
||||||
*
|
*
|
||||||
* @param \Entities\FeedEntry $entries
|
* @param \Entities\FeedEntry $entries
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function addEntry(\Entities\FeedEntry $entries)
|
public function addEntry(\Entities\FeedEntry $entries)
|
||||||
@@ -243,6 +242,7 @@ class Feed implements FeedInterface
|
|||||||
if (null === $how_many) {
|
if (null === $how_many) {
|
||||||
return $this->entries;
|
return $this->entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->entries->slice($offset_start, $how_many);
|
return $this->entries->slice($offset_start, $how_many);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,6 +276,7 @@ class Feed implements FeedInterface
|
|||||||
{
|
{
|
||||||
if ($collection === null) {
|
if ($collection === null) {
|
||||||
$this->base_id = null;
|
$this->base_id = null;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->base_id = $collection->get_base_id();
|
$this->base_id = $collection->get_base_id();
|
||||||
@@ -284,7 +285,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Set created_on
|
* Set created_on
|
||||||
*
|
*
|
||||||
* @param \DateTime $createdOn
|
* @param \DateTime $createdOn
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function setCreatedOn($createdOn)
|
public function setCreatedOn($createdOn)
|
||||||
@@ -307,7 +308,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Set updated_on
|
* Set updated_on
|
||||||
*
|
*
|
||||||
* @param \DateTime $updatedOn
|
* @param \DateTime $updatedOn
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function setUpdatedOn($updatedOn)
|
public function setUpdatedOn($updatedOn)
|
||||||
@@ -352,7 +353,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Set subtitle
|
* Set subtitle
|
||||||
*
|
*
|
||||||
* @param string $subtitle
|
* @param string $subtitle
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function setSubtitle($subtitle)
|
public function setSubtitle($subtitle)
|
||||||
@@ -394,7 +395,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Add tokens
|
* Add tokens
|
||||||
*
|
*
|
||||||
* @param \Entities\FeedToken $tokens
|
* @param \Entities\FeedToken $tokens
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function addToken(\Entities\FeedToken $tokens)
|
public function addToken(\Entities\FeedToken $tokens)
|
||||||
@@ -427,7 +428,7 @@ class Feed implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Add entries
|
* Add entries
|
||||||
*
|
*
|
||||||
* @param \Entities\FeedEntry $entries
|
* @param \Entities\FeedEntry $entries
|
||||||
* @return Feed
|
* @return Feed
|
||||||
*/
|
*/
|
||||||
public function addEntrie(\Entities\FeedEntry $entries)
|
public function addEntrie(\Entities\FeedEntry $entries)
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Entities;
|
namespace Entities;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FeedEntry
|
* FeedEntry
|
||||||
*/
|
*/
|
||||||
@@ -80,7 +78,7 @@ class FeedEntry
|
|||||||
/**
|
/**
|
||||||
* Set title
|
* Set title
|
||||||
*
|
*
|
||||||
* @param string $title
|
* @param string $title
|
||||||
* @return FeedEntry
|
* @return FeedEntry
|
||||||
*/
|
*/
|
||||||
public function setTitle($title)
|
public function setTitle($title)
|
||||||
@@ -103,7 +101,7 @@ class FeedEntry
|
|||||||
/**
|
/**
|
||||||
* Set subtitle
|
* Set subtitle
|
||||||
*
|
*
|
||||||
* @param string $subtitle
|
* @param string $subtitle
|
||||||
* @return FeedEntry
|
* @return FeedEntry
|
||||||
*/
|
*/
|
||||||
public function setSubtitle($subtitle)
|
public function setSubtitle($subtitle)
|
||||||
@@ -126,7 +124,7 @@ class FeedEntry
|
|||||||
/**
|
/**
|
||||||
* Set author_name
|
* Set author_name
|
||||||
*
|
*
|
||||||
* @param string $authorName
|
* @param string $authorName
|
||||||
* @return FeedEntry
|
* @return FeedEntry
|
||||||
*/
|
*/
|
||||||
public function setAuthorName($authorName)
|
public function setAuthorName($authorName)
|
||||||
@@ -149,7 +147,7 @@ class FeedEntry
|
|||||||
/**
|
/**
|
||||||
* Set author_email
|
* Set author_email
|
||||||
*
|
*
|
||||||
* @param string $authorEmail
|
* @param string $authorEmail
|
||||||
* @return FeedEntry
|
* @return FeedEntry
|
||||||
*/
|
*/
|
||||||
public function setAuthorEmail($authorEmail)
|
public function setAuthorEmail($authorEmail)
|
||||||
@@ -172,7 +170,7 @@ class FeedEntry
|
|||||||
/**
|
/**
|
||||||
* Set created
|
* Set created
|
||||||
*
|
*
|
||||||
* @param \DateTime $createdOn
|
* @param \DateTime $createdOn
|
||||||
* @return FeedEntry
|
* @return FeedEntry
|
||||||
*/
|
*/
|
||||||
public function setCreatedOn($createdOn)
|
public function setCreatedOn($createdOn)
|
||||||
@@ -195,7 +193,7 @@ class FeedEntry
|
|||||||
/**
|
/**
|
||||||
* Set updated
|
* Set updated
|
||||||
*
|
*
|
||||||
* @param \DateTime $updated
|
* @param \DateTime $updated
|
||||||
* @return FeedEntry
|
* @return FeedEntry
|
||||||
*/
|
*/
|
||||||
public function setUpdatedOn($updatedOn)
|
public function setUpdatedOn($updatedOn)
|
||||||
@@ -218,7 +216,7 @@ class FeedEntry
|
|||||||
/**
|
/**
|
||||||
* Add items
|
* Add items
|
||||||
*
|
*
|
||||||
* @param \Entities\FeedItem $items
|
* @param \Entities\FeedItem $items
|
||||||
* @return FeedEntry
|
* @return FeedEntry
|
||||||
*/
|
*/
|
||||||
public function addItem(\Entities\FeedItem $items)
|
public function addItem(\Entities\FeedItem $items)
|
||||||
@@ -251,7 +249,7 @@ class FeedEntry
|
|||||||
/**
|
/**
|
||||||
* Set publisher
|
* Set publisher
|
||||||
*
|
*
|
||||||
* @param \Entities\FeedPublisher $publisher
|
* @param \Entities\FeedPublisher $publisher
|
||||||
* @return FeedEntry
|
* @return FeedEntry
|
||||||
*/
|
*/
|
||||||
public function setPublisher(\Entities\FeedPublisher $publisher = null)
|
public function setPublisher(\Entities\FeedPublisher $publisher = null)
|
||||||
@@ -274,7 +272,7 @@ class FeedEntry
|
|||||||
/**
|
/**
|
||||||
* Set feed
|
* Set feed
|
||||||
*
|
*
|
||||||
* @param \Entities\Feed $feed
|
* @param \Entities\Feed $feed
|
||||||
* @return FeedEntry
|
* @return FeedEntry
|
||||||
*/
|
*/
|
||||||
public function setFeed(\Entities\Feed $feed = null)
|
public function setFeed(\Entities\Feed $feed = null)
|
||||||
|
@@ -52,7 +52,7 @@ class FeedItem
|
|||||||
/**
|
/**
|
||||||
* Set record_id
|
* Set record_id
|
||||||
*
|
*
|
||||||
* @param integer $recordId
|
* @param integer $recordId
|
||||||
* @return FeedItem
|
* @return FeedItem
|
||||||
*/
|
*/
|
||||||
public function setRecordId($recordId)
|
public function setRecordId($recordId)
|
||||||
@@ -75,7 +75,7 @@ class FeedItem
|
|||||||
/**
|
/**
|
||||||
* Set sbas_id
|
* Set sbas_id
|
||||||
*
|
*
|
||||||
* @param integer $sbasId
|
* @param integer $sbasId
|
||||||
* @return FeedItem
|
* @return FeedItem
|
||||||
*/
|
*/
|
||||||
public function setSbasId($sbasId)
|
public function setSbasId($sbasId)
|
||||||
@@ -98,7 +98,7 @@ class FeedItem
|
|||||||
/**
|
/**
|
||||||
* Set entry
|
* Set entry
|
||||||
*
|
*
|
||||||
* @param \Entities\FeedEntry $entry
|
* @param \Entities\FeedEntry $entry
|
||||||
* @return FeedItem
|
* @return FeedItem
|
||||||
*/
|
*/
|
||||||
public function setEntry(\Entities\FeedEntry $entry = null)
|
public function setEntry(\Entities\FeedEntry $entry = null)
|
||||||
@@ -122,11 +122,10 @@ class FeedItem
|
|||||||
*/
|
*/
|
||||||
private $ord;
|
private $ord;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set ord
|
* Set ord
|
||||||
*
|
*
|
||||||
* @param integer $ord
|
* @param integer $ord
|
||||||
* @return FeedItem
|
* @return FeedItem
|
||||||
*/
|
*/
|
||||||
public function setOrd($ord)
|
public function setOrd($ord)
|
||||||
@@ -149,7 +148,7 @@ class FeedItem
|
|||||||
/**
|
/**
|
||||||
* Set created_on
|
* Set created_on
|
||||||
*
|
*
|
||||||
* @param \DateTime $createdOn
|
* @param \DateTime $createdOn
|
||||||
* @return FeedItem
|
* @return FeedItem
|
||||||
*/
|
*/
|
||||||
public function setCreatedOn($createdOn)
|
public function setCreatedOn($createdOn)
|
||||||
@@ -172,7 +171,7 @@ class FeedItem
|
|||||||
/**
|
/**
|
||||||
* Set updated_on
|
* Set updated_on
|
||||||
*
|
*
|
||||||
* @param \DateTime $updatedOn
|
* @param \DateTime $updatedOn
|
||||||
* @return FeedItem
|
* @return FeedItem
|
||||||
*/
|
*/
|
||||||
public function setUpdatedOn($updatedOn)
|
public function setUpdatedOn($updatedOn)
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
namespace Entities;
|
namespace Entities;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FeedPublisher
|
* FeedPublisher
|
||||||
@@ -35,7 +34,6 @@ class FeedPublisher
|
|||||||
*/
|
*/
|
||||||
private $feed;
|
private $feed;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
*
|
*
|
||||||
@@ -49,7 +47,7 @@ class FeedPublisher
|
|||||||
/**
|
/**
|
||||||
* Set usr_id
|
* Set usr_id
|
||||||
*
|
*
|
||||||
* @param integer $usrId
|
* @param integer $usrId
|
||||||
* @return FeedPublisher
|
* @return FeedPublisher
|
||||||
*/
|
*/
|
||||||
public function setUsrId($usrId)
|
public function setUsrId($usrId)
|
||||||
@@ -72,7 +70,7 @@ class FeedPublisher
|
|||||||
/**
|
/**
|
||||||
* Set owner
|
* Set owner
|
||||||
*
|
*
|
||||||
* @param boolean $owner
|
* @param boolean $owner
|
||||||
* @return FeedPublisher
|
* @return FeedPublisher
|
||||||
*/
|
*/
|
||||||
public function setIsOwner($owner)
|
public function setIsOwner($owner)
|
||||||
@@ -95,7 +93,7 @@ class FeedPublisher
|
|||||||
/**
|
/**
|
||||||
* Set feed
|
* Set feed
|
||||||
*
|
*
|
||||||
* @param \Entities\Feed $feed
|
* @param \Entities\Feed $feed
|
||||||
* @return FeedPublisher
|
* @return FeedPublisher
|
||||||
*/
|
*/
|
||||||
public function setFeed(\Entities\Feed $feed = null)
|
public function setFeed(\Entities\Feed $feed = null)
|
||||||
@@ -115,7 +113,6 @@ class FeedPublisher
|
|||||||
return $this->feed;
|
return $this->feed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get user
|
* Get user
|
||||||
*
|
*
|
||||||
@@ -131,7 +128,7 @@ class FeedPublisher
|
|||||||
/**
|
/**
|
||||||
* Set created_on
|
* Set created_on
|
||||||
*
|
*
|
||||||
* @param \DateTime $createdOn
|
* @param \DateTime $createdOn
|
||||||
* @return FeedPublisher
|
* @return FeedPublisher
|
||||||
*/
|
*/
|
||||||
public function setCreatedOn($createdOn)
|
public function setCreatedOn($createdOn)
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Entities;
|
namespace Entities;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
|
|
||||||
class FeedToken
|
class FeedToken
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -21,7 +19,6 @@ class FeedToken
|
|||||||
*/
|
*/
|
||||||
private $feed;
|
private $feed;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
*
|
*
|
||||||
@@ -35,7 +32,7 @@ class FeedToken
|
|||||||
/**
|
/**
|
||||||
* Set usr_id
|
* Set usr_id
|
||||||
*
|
*
|
||||||
* @param integer $usrId
|
* @param integer $usrId
|
||||||
* @return FeedToken
|
* @return FeedToken
|
||||||
*/
|
*/
|
||||||
public function setUsrId($usrId)
|
public function setUsrId($usrId)
|
||||||
@@ -58,7 +55,7 @@ class FeedToken
|
|||||||
/**
|
/**
|
||||||
* Set feed
|
* Set feed
|
||||||
*
|
*
|
||||||
* @param \Entities\Feed $feed
|
* @param \Entities\Feed $feed
|
||||||
* @return FeedToken
|
* @return FeedToken
|
||||||
*/
|
*/
|
||||||
public function setFeed(\Entities\Feed $feed = null)
|
public function setFeed(\Entities\Feed $feed = null)
|
||||||
@@ -82,11 +79,10 @@ class FeedToken
|
|||||||
*/
|
*/
|
||||||
private $value;
|
private $value;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set value
|
* Set value
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @return FeedToken
|
* @return FeedToken
|
||||||
*/
|
*/
|
||||||
public function setValue($value)
|
public function setValue($value)
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
namespace Repositories;
|
namespace Repositories;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Entities\Feed;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AggregateTokenRepository
|
* AggregateTokenRepository
|
||||||
|
@@ -16,7 +16,7 @@ class SessionRepository extends EntityRepository
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param User_Adapter $user
|
* @param User_Adapter $user
|
||||||
* @return \Doctrine\Common\Collections\Collection
|
* @return \Doctrine\Common\Collections\Collection
|
||||||
*/
|
*/
|
||||||
public function getAllForUser(\User_Adapter $user)
|
public function getAllForUser(\User_Adapter $user)
|
||||||
|
@@ -1583,8 +1583,8 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
/**
|
/**
|
||||||
* Retrieve detailled informations about one feed
|
* Retrieve detailled informations about one feed
|
||||||
*
|
*
|
||||||
* @param Feed $feed
|
* @param Feed $feed
|
||||||
* @param type $user
|
* @param type $user
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function list_publication(Feed $feed, $user)
|
protected function list_publication(Feed $feed, $user)
|
||||||
@@ -1607,8 +1607,8 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
* Retrieve all entries of one feed
|
* Retrieve all entries of one feed
|
||||||
*
|
*
|
||||||
* @param FeedInterface $feed
|
* @param FeedInterface $feed
|
||||||
* @param int $offset_start
|
* @param int $offset_start
|
||||||
* @param int $how_many
|
* @param int $how_many
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function list_publications_entries(FeedInterface $feed, $offset_start = 0, $how_many = 5)
|
protected function list_publications_entries(FeedInterface $feed, $offset_start = 0, $how_many = 5)
|
||||||
|
@@ -43,8 +43,7 @@ class LoadOneFeed extends AbstractFixture implements FixtureInterface
|
|||||||
$feed->addPublisher($publisher);
|
$feed->addPublisher($publisher);
|
||||||
if (isset($this->title) && $this->title !== null) {
|
if (isset($this->title) && $this->title !== null) {
|
||||||
$feed->setTitle($this->title);
|
$feed->setTitle($this->title);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$feed->setTitle("test");
|
$feed->setTitle("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user