本文整理汇总了PHP中parent::convertDataObject方法的典型用法代码示例。如果您正苦于以下问题:PHP parent::convertDataObject方法的具体用法?PHP parent::convertDataObject怎么用?PHP parent::convertDataObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parent
的用法示例。
在下文中一共展示了parent::convertDataObject方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
// run customizations required by this particular class
// set custom nameservers to nameserver_list
if (isset($dataObject->data)) {
if ($dataObject->data->custom_nameservers == 1) {
$newDataObject->attributes->nameserver_list = array();
for ($j = 1; $j <= 10; ++$j) {
$tns = 'name' . $j;
$tso = 'sortorder' . $j;
if (isset($dataObject->data->{$tns}) && $dataObject->data->{$tns} != '' && isset($dataObject->data->{$tso}) && $dataObject->data->{$tso}) {
$nameserver = new \stdClass();
$nameserver->name = $dataObject->data->{$tns};
$nameserver->sortorder = $dataObject->data->{$tso};
$newDataObject->attributes->nameserver_list[] = $nameserver;
}
}
}
}
if (isset($dataObject->personal)) {
$newDataObject->attributes->contact_set = new \stdClass();
$newDataObject->attributes->contact_set->owner = $dataObject->personal;
$newDataObject->attributes->contact_set->admin = $dataObject->personal;
$newDataObject->attributes->contact_set->billing = $dataObject->personal;
$newDataObject->attributes->contact_set->tech = $dataObject->personal;
}
// end customizations
return $newDataObject;
}
示例2: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
$tlds = array();
if (isset($dataObject->data->selected) && $dataObject->data->selected) {
$tlds = explode(';', $dataObject->data->selected);
}
if (empty($tlds) && isset($dataObject->data->defaulttld) && $dataObject->data->defaulttld) {
$tlds = explode(';', $dataObject->data->defaulttld);
}
if (empty($tlds)) {
$tlds = $this->defaultTlds;
}
/*
* setting service_override
*/
$newDataObject->attributes->service_override = new \stdClass();
$service_override = new \stdCLass();
$service_override->tlds = $tlds;
if (isset($dataObject->data->maximum) && $dataObject->data->maximum) {
$service_override->maximum = $dataObject->data->maximum;
}
$newDataObject->attributes->service_override->suggestion = $service_override;
$newDataObject->attributes->services = array('suggestion');
/* end setting service_override **/
return $newDataObject;
}
示例3: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
// run customizations required by this particular class
// set custom nameservers to nameserver_list
if (isset($dataObject->data->nameserver_names) && $dataObject->data->nameserver_names != '') {
$nameServers = explode(',', $dataObject->data->nameserver_names);
if (isset($dataObject->data->nameserver_ips) && $dataObject->data->nameserver_ips != '') {
$ipAddresses = explode(',', $dataObject->data->nameserver_ips);
} else {
$ipAddresses = array();
}
$i = 0;
$newDataObject->attributes->nameserver_list = array();
for ($i = 0; $i < count($nameServers); ++$i) {
$nameserver_obj = new \stdClass();
$nameserver_obj->fqdn = $nameServers[$i];
if (isset($ipAddresses[$i])) {
$nameserver_obj->fqdn = $ipAddresses[$i];
}
}
}
// end customizations
return $newDataObject;
}
示例4: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
return $newDataObject;
}
示例5: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
$newDataObject->attributes->add_to_all_registry = explode(',', $newDataObject->attributes->add_to_all_registry);
return $newDataObject;
}
示例6: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
if (!is_array($newDataObject->attributes->change_items)) {
$newDataObject->attributes->change_items = explode(',', $newDataObject->attributes->change_items);
}
return $newDataObject;
}
示例7: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
// make sure attributes->reg_domain is set, even if it's
// an empty string
if (!isset($newDataObject->attributes->reg_domain)) {
$newDataObject->attributes->reg_domain = '';
}
return $newDataObject;
}
示例8: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
// run old 'getTlds' method (now called 'getServiceOverride') to get
// info that should be part of service override entries
$newDataObject->attributes->service_override = $this->getServiceOverride($dataObject);
$newDataObject->attributes->services = array('lookup', 'suggestion');
/* end setting service_override **/
return $newDataObject;
}
示例9: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
// set attributes->domain_list
if (!is_object($newDataObject->attributes)) {
$newDataObject->attributes = new \stdClass();
}
$newDataObject->attributes->domain_list = explode(',', $dataObject->data->domain_list);
return $newDataObject;
}
示例10: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
// run customizations required by this particular class
// make sure attributes->types is an array on the new
// object
if (!is_array($newDataObject->attributes->types)) {
$newDataObject->attributes->types = explode(',', $newDataObject->attributes->types);
}
// end customizations
return $newDataObject;
}
示例11: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
// run customizations required by this particular class
if (isset($newDataObject->contact_set) && isset($dataObject->personal)) {
$newDataObject->contact_set = new \stdClass();
$contact_types = explode(',', $dataObject->data->contact_type);
foreach ($contact_types as $contact_type) {
$newDataObject->contact_set->{$contact_type} = $dataObject->personal;
}
}
// end customizations
return $newDataObject;
}
示例12: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
/*
* Convert fields that should be arrays to arrays
*/
if (isset($newDataObject->attributes->add_ns)) {
$newDataObject->attributes->add_ns = explode(',', $newDataObject->attributes->add_ns);
}
if (isset($newDataObject->attributes->assign_ns)) {
$newDataObject->attributes->assign_ns = explode(',', $newDataObject->attributes->assign_ns);
}
if (isset($newDataObject->attributes->remove_ns)) {
$newDataObject->attributes->remove_ns = explode(',', $newDataObject->attributes->remove_ns);
}
return $newDataObject;
}
示例13: convertDataObject
public function convertDataObject($dataObject, $newStructure = null)
{
$p = new parent();
if (is_null($newStructure)) {
$newStructure = $this->newStructure;
}
$newDataObject = $p->convertDataObject($dataObject, $newStructure);
// explode change_items into an array
// if it isn't already
if (!is_array($newDataObject->attributes->change_items)) {
$newDataObject->attributes->change_items = explode(',', $newDataObject->attributes->change_items);
}
// build attributes->contacts array.
// data->type is the contact_type,
// data->personal is the contact record
if (isset($dataObject->data->type) && $dataObject->data->type != '' && isset($dataObject->personal) && $dataObject->personal != '') {
$newDataObject->attributes->contacts = array();
$contact_types = explode(',', $dataObject->data->type);
foreach ($contact_types as $i => $contact_type) {
$contact = new \stdClass();
$contact->set = $dataObject->personal;
$contact->type = $contact_type;
$newDataObject->attributes->contacts[] = $contact;
unset($contact);
}
}
// explode *_ns fields into arrays if they exist
// and are not already arrays
if (isset($newDataObject->attributes->add_ns) && !is_array($newDataObject->attributes->add_ns)) {
$newDataObject->attributes->add_ns = explode(',', $newDataObject->attributes->add_ns);
}
if (isset($newDataObject->attributes->remove_ns) && !is_array($newDataObject->attributes->remove_ns)) {
$newDataObject->attributes->remove_ns = explode(',', $newDataObject->attributes->remove_ns);
}
if (isset($newDataObject->attributes->assign_ns) && !is_array($newDataObject->attributes->assign_ns)) {
$newDataObject->attributes->assign_ns = explode(',', $newDataObject->attributes->assign_ns);
}
return $newDataObject;
}