本文整理汇总了PHP中Members::findByObjectId方法的典型用法代码示例。如果您正苦于以下问题:PHP Members::findByObjectId方法的具体用法?PHP Members::findByObjectId怎么用?PHP Members::findByObjectId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Members
的用法示例。
在下文中一共展示了Members::findByObjectId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: core_dimensions_after_update
/**
* @author Ignacio Vazquez - elpepe.uy at gmail.com
* @param unknown_type $object
* @param unknown_type $ignored
*/
function core_dimensions_after_update($object, &$ignored)
{
static $objectsProcessed = array();
if ($object instanceof Contact && !array_var($objectsProcessed, $object->getId())) {
$person_dim = Dimensions::findOne(array("conditions" => "`code` = 'feng_persons'"));
$person_ot = ObjectTypes::findOne(array("conditions" => "`name` = 'person'"));
$company_ot = ObjectTypes::findOne(array("conditions" => "`name` = 'company'"));
$members = Members::findByObjectId($object->getId(), $person_dim->getId());
if (count($members) == 1) {
/* @var $member Member */
$member = $members[0];
$member->setName($object->getObjectName());
$parent_member_id = $member->getParentMemberId();
$depth = $member->getDepth();
if ($object->getCompanyId() > 0) {
$pmember = Members::findOne(array('conditions' => '`object_id` = ' . $object->getCompanyId() . ' AND `object_type_id` = ' . $company_ot->getId() . ' AND `dimension_id` = ' . $person_dim->getId()));
$member->setParentMemberId($pmember->getId());
$member->setDepth($pmember->getDepth() + 1);
} else {
//Is first level
$member->setDepth(1);
$member->setParentMemberId(0);
}
$object->modifyMemberValidations($member);
$member->save();
// reload only if not disabling or enabling user
if (!(array_var($_REQUEST, 'c') == 'account' && (array_var($_REQUEST, 'a') == 'disable' || array_var($_REQUEST, 'a') == 'restore_user'))) {
evt_add("reload dimension tree", $member->getDimensionId());
}
$objectsProcessed[$object->getId()] = true;
}
}
}
示例2: modifyMemberValidations
function modifyMemberValidations($member)
{
if ($member instanceof Member) {
$member->add_skip_validation('uniqueness of parent - name');
} else {
if ($this->getId() > 0 && Plugins::instance()->isActivePlugin('core_dimensions')) {
$dim = Dimensions::findByCode('feng_persons');
if ($dim instanceof Dimension) {
$m = Members::findByObjectId($this->getId(), $dim->getId());
if ($m instanceof Member) {
$m->add_skip_validation('uniqueness of parent - name');
}
}
}
}
}