mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 19:43:16 +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);
|
||||
|
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Model\Entities\User;
|
||||
|
||||
class patch_381alpha3a implements patchInterface
|
||||
{
|
||||
@@ -59,7 +60,7 @@ class patch_381alpha3a implements patchInterface
|
||||
$propSql = $propArgs = [];
|
||||
$n = 0;
|
||||
|
||||
foreach (\User_Adapter::$def_values as $prop => $value) {
|
||||
foreach (User::$defaultUserSettings as $prop => $value) {
|
||||
if ('start_page_query' === $prop) {
|
||||
continue;
|
||||
}
|
||||
|
@@ -93,9 +93,7 @@ class patch_390alpha6a implements patchInterface
|
||||
$n = 0;
|
||||
|
||||
foreach ($rs as $row) {
|
||||
try {
|
||||
$user = \User_Adapter::getInstance($row['usr_id'], $app);
|
||||
} catch (\Exception $e) {
|
||||
if (null === $user = $app['manipulator.user']->getRepository()->find($row['usr_id'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user