mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Remove User_Adapter
This commit is contained in:
@@ -88,7 +88,7 @@ class patch_320alpha4b implements patchInterface
|
||||
|
||||
$app['EM']->getEventManager()->removeEventSubscriber(new TimestampableListener());
|
||||
foreach ($rs as $row) {
|
||||
$user = User_Adapter::getInstance($row['usr_id'], $app);
|
||||
$user = $app['manipulator.user']->getRepository()->find($row['usr_id']);
|
||||
|
||||
$feed = $this->get_feed($appbox, $user, $row['pub_restrict'], $row['homelink'], $app);
|
||||
|
||||
@@ -99,8 +99,8 @@ class patch_320alpha4b implements patchInterface
|
||||
$publishers = $feed->getPublishers();
|
||||
|
||||
$entry = new FeedEntry();
|
||||
$entry->setAuthorEmail($user->get_email());
|
||||
$entry->setAuthorName($user->get_display_name());
|
||||
$entry->setAuthorEmail($user->getEmail());
|
||||
$entry->setAuthorName($user->getDisplayName());
|
||||
$entry->setFeed($feed);
|
||||
$entry->setPublisher($publishers->first());
|
||||
$entry->setTitle($row['name']);
|
||||
@@ -175,9 +175,9 @@ class patch_320alpha4b implements patchInterface
|
||||
}
|
||||
protected static $feeds = [];
|
||||
|
||||
protected function get_feed(appbox $appbox, User_Adapter $user, $pub_restrict, $homelink, Application $app)
|
||||
protected function get_feed(appbox $appbox, User $user, $pub_restrict, $homelink, Application $app)
|
||||
{
|
||||
$user_key = 'user_' . $user->get_id();
|
||||
$user_key = 'user_' . $user->getId();
|
||||
if ($homelink == '1') {
|
||||
$feed_key = 'feed_homelink';
|
||||
} elseif ($pub_restrict == '1') {
|
||||
@@ -188,11 +188,11 @@ class patch_320alpha4b implements patchInterface
|
||||
|
||||
if ( ! array_key_exists($user_key, self::$feeds) || ! isset(self::$feeds[$user_key][$feed_key])) {
|
||||
if ($homelink == '1')
|
||||
$title = $user->get_display_name() . ' - ' . 'homelink Feed';
|
||||
$title = $user->getDisplayName() . ' - ' . 'homelink Feed';
|
||||
elseif ($pub_restrict == '1')
|
||||
$title = $user->get_display_name() . ' - ' . 'private Feed';
|
||||
$title = $user->getDisplayName() . ' - ' . 'private Feed';
|
||||
else
|
||||
$title = $user->get_display_name() . ' - ' . 'public Feed';
|
||||
$title = $user->getDisplayName() . ' - ' . 'public Feed';
|
||||
|
||||
$feed = new Feed();
|
||||
$publisher = new FeedPublisher();
|
||||
@@ -201,7 +201,7 @@ class patch_320alpha4b implements patchInterface
|
||||
$feed->addPublisher($publisher);
|
||||
$publisher->setFeed($feed);
|
||||
$publisher->setOwner(true);
|
||||
$publisher->setUsrId($user->get_id());
|
||||
$publisher->setUsrId($user->getId());
|
||||
|
||||
if ($homelink) {
|
||||
$feed->setPublic(true);
|
||||
|
Reference in New Issue
Block a user