本文整理汇总了PHP中Organization::write方法的典型用法代码示例。如果您正苦于以下问题:PHP Organization::write方法的具体用法?PHP Organization::write怎么用?PHP Organization::write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Organization
的用法示例。
在下文中一共展示了Organization::write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doApprove
public function doApprove()
{
$exist = Member::get()->filter(array('Email' => $this->Email))->first();
if ($exist) {
return false;
}
$member = new Member();
$data = $this->toMap();
unset($data['ID']);
unset($data['ClassName']);
unset($data['UnapprovedMember']);
$member->update($data);
$member->write();
if ($this->MemberType === 'Organization') {
$member->addToGroupByCode('organization');
$organization = new Organization();
$organization->AccountID = $member->ID;
$organization->company_name = $this->OrganizationName;
$organizationID = $organization->write();
$member->OrganizationID = $organizationID;
$member->write();
} else {
$member->addToGroupByCode('personal');
}
$this->setField('Approved', true);
$this->write();
return true;
}
示例2: findOrCreateOrganization
public function findOrCreateOrganization()
{
$organization = $this->owner->Organization();
if ($organization->ID) {
return $organization;
}
$organization = new Organization();
$organization->write();
$organization->Members()->add($this->owner);
return $organization;
}