PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Framework
/
Helpers
<?php namespace WilokeListingTools\Framework\Helpers; use WILCITY_SC\SCHelpers; use WilokeListingTools\Controllers\ReviewController; use WilokeListingTools\Framework\Helpers\Collection\ArrayCollectionFactory; use WilokeListingTools\Frontend\BusinessHours; use WilokeListingTools\Frontend\SingleListing; use WilokeListingTools\Frontend\User; use WilokeListingTools\Models\FollowerModel; use WilokeListingTools\Models\ReviewMetaModel; use WilokeListingTools\Models\UserModel; class UserSkeleton { private $userID; public function __construct($userID) { $this->userID = $userID; } public function getDisplayName() { return User::getField('display_name', $this->userID); } public function getPhone() { return User::getPhone($this->userID); } public function getEmail() { return User::getField('user_email', $this->userID); } public function getAvatar() { return User::getAvatar($this->userID); } public function getAddress() { return User::getAddress($this->userID); } public function getTotalFollowings() { return FollowerModel::countFollowings($this->userID); } public function getTotalFollowers() { return FollowerModel::countFollowers($this->userID); } public function getAuthorPostsUrl() { return get_author_posts_url($this->userID); } public function getAuthorLink() { return $this->getAuthorPostsUrl(); } public function getUserMeta($key) { return GetSettings::getUserMeta($this->userID, $key); } public function pluck($pluck) { if (empty($this->userID)) { return []; } $aPluck = is_array($pluck) ? $pluck : explode(',', $pluck); $aPluck = array_map(function ($rawMethod) { $method = trim($rawMethod); $method = explode('_', $method); $method = array_map(function ($item) { return ucfirst($item); }, $method); return [ 'key' => $rawMethod, 'method' => 'get'.implode('', $method) ]; }, $aPluck); $aData = []; foreach ($aPluck as $aMethod) { if (method_exists($this, $aMethod['method'])) { $val = $this->{$aMethod['method']}(); } else { $val = $this->getUserMeta($aMethod['key']); } if (!empty($val)) { $aData[$aMethod['key']] = $val; } } return $aData; } }
[+]
..
[-] SearchFieldSkeleton.php
[edit]
[-] FileSystem.php
[edit]
[-] Response.php
[edit]
[-] GetWilokeSubmission.php
[edit]
[-] AbstractSkeleton.php
[edit]
[-] InheritCMB2Styles.php
[edit]
[-] ReviewSkeleton.php
[edit]
[-] RestaurantMenu.php
[edit]
[-] WooCommerce.php
[edit]
[-] MapHelpers.php
[edit]
[-] .DS_Store
[edit]
[-] Message.php
[edit]
[-] GetSettings.php
[edit]
[-] QueryHelper.php
[edit]
[+]
Collection
[-] Inc.php
[edit]
[-] UserSkeleton.php
[edit]
[-] Firebase.php
[edit]
[-] Repository.php
[edit]
[-] DebugStatus.php
[edit]
[-] MapFactory.php
[edit]
[-] SetSettings.php
[edit]
[-] AddListingFieldSkeleton.php
[edit]
[-] VideoHelper.php
[edit]
[-] SearchFormSkeleton.php
[edit]
[-] PostSkeleton.php
[edit]
[-] KCHelpers.php
[edit]
[-] ProductSkeleton.php
[edit]
[-] QRCodeGenerator.php
[edit]
[-] HTML.php
[edit]
[-] Time.php
[edit]
[-] PlanHelper.php
[edit]
[-] SemanticUi.php
[edit]
[-] AjaxMsg.php
[edit]
[-] Logger.php
[edit]
[-] Cookie.php
[edit]
[-] Validation.php
[edit]
[-] GalleryHelper.php
[edit]
[-] AuthorSkeleton.php
[edit]
[-] General.php
[edit]
[-] Submission.php
[edit]
[-] TermSetting.php
[edit]