本文整理汇总了PHP中Customers::getLast方法的典型用法代码示例。如果您正苦于以下问题:PHP Customers::getLast方法的具体用法?PHP Customers::getLast怎么用?PHP Customers::getLast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers::getLast方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveCustomer
/**
* saveCustomer
* Save the owner of the domain when we download the information using the Soap service
* @param $domaininfo
* @param $owner
* @return [boolean, Doctrine_Record]
*/
public static function saveCustomer($domaininfo, $owner)
{
// Check the existence of the record
$arrCustomer = CustomersDomainsRegistrars::getAllInfo($domaininfo['nichandle'], "customer_id as customerid");
if (!empty($arrCustomer) && count($arrCustomer) > 0) {
$customer = Doctrine::getTable('Customers')->find($arrCustomer['customerid']);
} else {
$customer = new Customers();
}
// Add the Customer
$customer->firstname = $owner['firstname'];
$customer->lastname = $owner['lastname'];
$customer->email = $owner['email'];
$customer->vat = $owner['vat'];
$customer->company = $owner['organisation'];
$customer->legalform_id = !empty($owner['legalform']) ? Legalforms::getIDbyName($owner['legalform']) : null;
$customer->getLast()->toArray();
if ($customer->trySave()) {
return $customer;
} else {
return false;
}
}