@param $obj

@return \HpsPayPlanCustomer
513213
public static function fromStdClass($obj)
    {
        $ret = new HpsPayPlanCustomer();
        $ret->customerKey = property_exists($obj, 'customerKey') ? $obj->customerKey : null;
        $ret->customerIdentifier = property_exists($obj, 'customerIdentifier') ? $obj->customerIdentifier : null;
        $ret->firstName = property_exists($obj, 'firstName') ? $obj->firstName : null;
        $ret->lastName = property_exists($obj, 'lastName') ? $obj->lastName : null;
        $ret->company = property_exists($obj, 'company') ? $obj->company : null;
        $ret->customerStatus = property_exists($obj, 'customerStatus') ? $obj->customerStatus : null;
        $ret->primaryEmail = property_exists($obj, 'primaryEmail') ? $obj->primaryEmail : null;
        $ret->phoneDay = property_exists($obj, 'phoneDay') ? $obj->phoneDay : null;
        $ret->phoneDayExt = property_exists($obj, 'phoneDayExt') ? $obj->phoneDayExt : null;
        $ret->phoneEvening = property_exists($obj, 'phoneEvening') ? $obj->phoneEvening : null;
        $ret->phoneEveningExt = property_exists($obj, 'phoneEveningExt') ? $obj->phoneEveningExt : null;
        $ret->phoneMobile = property_exists($obj, 'phoneMobile') ? $obj->phoneMobile : null;
        $ret->phoneMobileExt = property_exists($obj, 'phoneMobileExt') ? $obj->phoneMobileExt : null;
        $ret->fax = property_exists($obj, 'fax') ? $obj->fax : null;
        $ret->title = property_exists($obj, 'title') ? $obj->title : null;
        $ret->department = property_exists($obj, 'department') ? $obj->department : null;
        $ret->addressLine1 = property_exists($obj, 'addressLine1') ? $obj->addressLine1 : null;
        $ret->addressLine2 = property_exists($obj, 'addressLine2') ? $obj->addressLine2 : null;
        $ret->city = property_exists($obj, 'city') ? $obj->city : null;
        $ret->country = property_exists($obj, 'country') ? $obj->country : null;
        $ret->stateProvince = property_exists($obj, 'stateProvince') ? $obj->stateProvince : null;
        $ret->zipPostalCode = property_exists($obj, 'zipPostalCode') ? $obj->zipPostalCode : null;
        $ret->paymentMethods = property_exists($obj, 'paymentMethods') ? array_map('HpsPayPlanPaymentMethod::fromStdClass', $obj->paymentMethods) : null;
        $ret->schedules = property_exists($obj, 'schedules') ? array_map('HpsPayPlanSchedule::fromStdClass', $obj->schedules) : null;
        $ret->creationDate = property_exists($obj, 'creationDate') ? $obj->creationDate : null;
        $ret->lastChangeDate = property_exists($obj, 'lastChangeDate') ? $obj->lastChangeDate : null;
        $ret->statusSetDate = property_exists($obj, 'statusSetDate') ? $obj->statusSetDate : null;
        return $ret;
    }
1102066
protected function parseChoice(ModelInterface $obj)
    {
        $choice = parent::parseChoice($obj);

        if (property_exists($obj, 'auxiliary') && $obj->auxiliary) {
            $choice['parent'] = true;
        } elseif ($obj instanceof HierarchicalInterface && $obj->hasMaster()) {
            $choice['group'] = parent::parseChoice($obj->master());
        } else {
            $choice['group'] = null;
        }

        if (is_callable([ $obj, 'name' ])) {
            $choice['title'] = $obj->name();
        } elseif (is_callable([ $obj, 'label' ])) {
            $choice['title'] = $obj->label();
        } elseif (is_callable([ $obj, 'title' ])) {
            $choice['title'] = $obj->title();
        }

        return $choice;
    }
1189024
public function attachServices($obj) {
		$args = get_class_vars( get_class($obj) );
		foreach ($args as $_k=>$_v) {
			if (substr($_k, -7) == 'Service') {
				$obj->$_k = _makePromise($_k);
			}
		}
	}
1177986
private function traverseObject($obj, $keys)
    {
        if (empty($keys)) {
            return $obj;
        }
        $key = current($keys);

        if (is_array($obj) && isset($obj[$key])) {
            return $this->traverseObject($obj[$key], array_slice($keys, 1));
        } else if (is_object($obj) && isset($obj->{$key})) {
            return $this->traverseObject($obj->{$key}, array_slice($keys, 1));
        } else {
            return null;
        }
    }
1221393
public static function setPatientCategories($obj, $type) {
		$entityManager = DoctrineBootstrap::getEntityManager ();
		$patient = PatientCRUD::getPatient ( $obj->id, $type );
		foreach ( get_object_vars ( $obj ) as $key => $value ) {
			call_user_func ( array (
					$patient,
					'set' . ucwords ( $key ) 
			), $value );
		}
		$entityManager->merge ( $patient );
		$entityManager->flush ();
		return $patient;
	}
624310
public function objectToXml($obj)
    {
        //====================================================================//
        // Create Transmition Object
        $tmp = new stdClass();
        $tmp->SPLASH = $obj;
        //====================================================================//
        // Convert Object to XML Recursively
        $this->objectToXmlCore(self::$xml, $tmp);
        //====================================================================//
        // Put End Element on Xml
        self::$xml->endElement();
        //====================================================================//
        // Output Result
        return self::$xml->outputMemory(true);
    }
625410
public static function setup(/* mixed */ $obj): void
    {
        if($obj instanceof Graph\GraphInterface) {
            Hooks\Graph::setup($obj);
        }
        // . (on purpose)
        if($obj instanceof Graph\EdgeInterface) {
            Hooks\Edge::setup($obj);
        }
        elseif($obj instanceof Graph\NodeInterface) {
            Hooks\Node::setup($obj);
        }
        elseif($obj instanceof AbstractNotification) {
            Hooks\Notification::setup($obj);
        }
    }
978496
public function renderAfterStep($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderAfterStep($obj);
        }

        return $print;
    }
873873
public function preCacheTranslateObject(ModelObject $obj)
    {
        $plugin = $this->PluginService->getByID($obj->PluginID);
        if(empty($plugin) || !$plugin->isInstalled() || !$plugin->isEnabled())
            return null;

        if($obj->getXMLSchema() != '') {
            // resolve schema
            $schemaXML = "<?xml version='1.0'?><schema>";
            $schemaXML .= preg_replace('/\<\?xml([^\>\/]*)\>/', '' , $obj->getXMLSchema());
            $schemaXML .= "</schema>";

            try {
                $schema = $this->NodeSchemaParser->parse($schemaXML);
            }catch(Exception $e){
                throw new SchemaException("Unable to parse schema for aspect [{$obj->Slug}]:\n ". $e->getMessage());
            }

            $obj->setSchema($schema);
        } else {
            $obj->setSchema(new NodeSchema());
        }


        return $obj;
    }
719238
public function createAttributeValue($obj)
    {
        if ($obj && !is_object($obj)) {
            $obj = File::getByID($obj);
        }

        $value = new ImageFileValue();
        $value->setFileObject($obj);

        return $value;
    }
506341
protected static function normalize($obj)
    {
        $result = null;

        if (is_object($obj)) {
            $obj = (array) $obj;
        }

        if (is_array($obj)) {
            foreach ($obj as $key => $value) {
                $res = self::normalize($value);
                if (('@attributes' === $key) && ($key)) {
                    $result = $res; // @codeCoverageIgnore
                } else {
                    $result[$key] = $res;
                }
            }
        } else {
            $result = $obj;
        }

        return $result;
    }
1243190
public function setContainerObj($obj)
    {
        if ($obj === null) {
            $this->containerObj = null;

            return $this;
        }

        if (!$obj instanceof AttachmentContainerInterface) {
            throw new InvalidArgumentException(sprintf(
                'Container object must be an instance of %s; received %s',
                AttachmentContainerInterface::class,
                (is_object($obj) ? get_class($obj) : gettype($obj))
            ));
        }

        if (!$obj->id()) {
            throw new InvalidArgumentException(sprintf(
                'Container object must have an ID.',
                (is_object($obj) ? get_class($obj) : gettype($obj))
            ));
        }

        $this->containerObj = $obj;

        return $this;
    }
1055261
protected function edit(ModelObject $obj)
    {
        if ($obj->{$obj->getPrimaryKey()} == null)
            $this->errors->reject("{$obj->getPrimaryKey()} is required to edit.")->throwOnError();

        if ($this->dao->getByID($obj->{$obj->getPrimaryKey()}) == false)
            $this->getErrors()->reject("Record not found for ID: " . $obj->{$obj->getPrimaryKey()})->throwOnError();

        if ($this->dao->slugExists($obj->Slug, $obj->{$obj->getPrimaryKey()}))
            $this->errors->reject("The slug for this ".get_class($obj)." record is already in use.")->throwOnError();

        $this->errors->validateModelObject($obj);
    }
454090
public function CompareTo( $obj )
	{
		if ( ! $obj instanceof AnyUriValue )
	        throw new ArgumentException();

		/**
		 * @var AnyUriValue $other
		 */
	    $other = $obj;
	    return strcmp( $this->Value, $other->Value );
	}
538921
public function renderBeforeExercise($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderBeforeExercise($obj);
        }

        return $print;
    }
834370
public function initByObj($obj)
  {
    if (!is_object($obj)){
      return $this;
    }elseif (class_exists('Illuminate\Pagination\LengthAwarePaginator') && $obj instanceof \Illuminate\Pagination\LengthAwarePaginator){
      // 如果是 分页对象
      call_user_func_array(array($this, 'LengthAwarePaginatorInit'), func_get_args());
    }elseif (class_exists('Illuminate\Database\Eloquent\Builder') && $obj instanceof \Illuminate\Database\Eloquent\Builder){
       // 如果是 数据库模型对象
        call_user_func_array(array($this, 'DatabaseBuilderInit'), func_get_args());
    }
    return $this;
  }
920350
public function dump($obj)
    {
        if (is_array($obj) || is_object($obj)) {
            $obj = print_r($obj, true);
        }

        $this->append('<pre>' .  htmlentities($obj, ENT_QUOTES) . "</pre><br />\n");

        return $this;
    }