本文整理汇总了PHP中CustomField::create方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomField::create方法的具体用法?PHP CustomField::create怎么用?PHP CustomField::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomField
的用法示例。
在下文中一共展示了CustomField::create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Factory method to create a Contact object from an array
* @param array $props - Associative array of initial properties to set
* @return Contact
*/
public static function create(array $props)
{
$contact = new Contact();
$contact->id = parent::getValue($props, "id");
$contact->status = parent::getValue($props, "status");
$contact->first_name = parent::getValue($props, "first_name");
$contact->middle_name = parent::getValue($props, "middle_name");
$contact->last_name = parent::getValue($props, "last_name");
$contact->confirmed = parent::getValue($props, "confirmed");
$contact->source = parent::getValue($props, "source");
foreach ($props['email_addresses'] as $email_address) {
$contact->email_addresses[] = EmailAddress::create($email_address);
}
$contact->prefix_name = parent::getValue($props, "prefix_name");
$contact->job_title = parent::getValue($props, "job_title");
foreach ($props['addresses'] as $address) {
$contact->addresses[] = Address::create($address);
}
foreach ($props['notes'] as $note) {
$contact->notes[] = Note::create($note);
}
$contact->company_name = parent::getValue($props, "company_name");
$contact->home_phone = parent::getValue($props, "home_phone");
$contact->work_phone = parent::getValue($props, "work_phone");
$contact->cell_phone = parent::getValue($props, "cell_phone");
$contact->fax = parent::getValue($props, "fax");
foreach ($props['custom_fields'] as $custom_field) {
$contact->custom_fields[] = CustomField::create($custom_field);
}
foreach ($props['lists'] as $contact_list) {
$contact->lists[] = ContactList::create($contact_list);
}
$contact->source_details = parent::getValue($props, "source_details");
return $contact;
}
示例2: create
function create()
{
// nem a kategoria specifikus, hanem az osszes kategoriara vonatkozoan kovetkezo columnIndexet allitjuk be.
// Igy elerjuk, hogy a columnIndex biztos ne legyen meg foglalt egyetlen mas kategoriaban sem.
if ($this->isCommon && !$this->isFixField()) {
if ($this->commonFieldAlreadyExists()) {
return;
}
$this->columnIndex = "col_" . CustomField::getNextColumnIndex();
}
parent::create();
if (!Roll::isFormInvalid() && $this->isCommon && !$this->isFixField()) {
$this->propagateCommonField();
}
}