当前位置: 首页>>代码示例>>PHP>>正文


PHP Members::findByObjectId方法代码示例

本文整理汇总了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;
        }
    }
}
开发者ID:rorteg,项目名称:fengoffice,代码行数:38,代码来源:core_dimensions_hooks.php

示例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');
                 }
             }
         }
     }
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:16,代码来源:Contact.class.php


注:本文中的Members::findByObjectId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。