本文整理汇总了PHP中Member::isLoaded方法的典型用法代码示例。如果您正苦于以下问题:PHP Member::isLoaded方法的具体用法?PHP Member::isLoaded怎么用?PHP Member::isLoaded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member::isLoaded方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMemberPostCount
/**
* returns a count of how many posts a member has made
*
* @param object $member - Member entity
* @access public
* @return int
*/
public function getMemberPostCount(Member $member)
{
if (!$member->isLoaded()) {
return 0;
}
return $this->countWhere("IdWriter = '{$member->getPKValue()}'");
}
示例2: setSpokenLanguage
/**
* sets a spoken language for a member
*
* @param object $member
* @param object $language
* @param string $level
* @access public
* @return bool
*/
public function setSpokenLanguage(Member $member, Language $language, $level)
{
if (!$member->isLoaded() || !$language->isLoaded() || empty($level)) {
return false;
}
$this->IdMember = $member->getPKValue();
$this->IdLanguage = $language->getPKValue();
$this->Level = $level;
$this->created = date('Y-m-d H:i:s');
return $this->insert();
}
示例3: createTrip
public function createTrip($vars, Member $user)
{
if (!is_array($vars) || !$user->isLoaded()) {
$vars['errors'][] = 'not_created';
return false;
}
$tripId = $this->insertTrip($vars['n'], $vars['d'], $user->id);
if (!$tripId) {
$vars['errors'][] = 'not_created';
return false;
}
if (isset($vars['cg']) && $vars['cg']) {
$Gallery = new GalleryModel();
$galleryId = $Gallery->createGallery($vars['n']);
if (!$galleryId) {
$vars['errors'][] = 'gallery_not_created';
} else {
$this->assignGallery($tripId, $galleryId);
}
}
return $tripId;
}
示例4: recordVisit
/**
* Records visit of current member to another member's profile, respecting
* "Show profile visits" preference.
*
* @param Member $member Visiting member entity
* @return bool True if visit recorded, false if not recorded
*/
public function recordVisit(Member $member)
{
if (!$this->isLoaded() || !$member->isLoaded()) {
return false;
}
$visitorShow = $member->getPreference('PreferenceShowProfileVisits', 'Yes');
$ownerShow = $this->getPreference('PreferenceShowProfileVisits', 'Yes');
if ($visitorShow == 'Yes' && $ownerShow == 'Yes') {
$visit = $this->createEntity('ProfileVisit');
if ($visit->recordVisit($this, $member) === false) {
return false;
} else {
return true;
}
} else {
return false;
}
}
示例5: getVisitCountForMember
/**
* returns number of members visiting $member
*
* @param Member $member - profile to check count for
*
* @access public
* @return int
*/
public function getVisitCountForMember(Member $member)
{
if (!$member->isLoaded()) {
return 0;
}
return $this->sqlCount("SELECT COUNT(m.id) FROM members AS m, {$this->getTableName()} AS p WHERE p.IdMember = {$member->getPKValue()} AND p.IdVisitor = m.id");
}
示例6: getMemberAddress
/**
* returns an address entity for the given member
*
* @param Member $member - Member entity
* @param int $rank - address rank
*
* @access public
* @return Address
*/
public function getMemberAddress(Member $member, $rank = 0)
{
if ($this->isLoaded() || !$member->isLoaded()) {
return false;
}
return $this->createEntity('Address')->findByWhere("IdMember = {$member->id} AND Rank = '{$this->dao->escape($rank)}'");
}