opensrs\backwardcompatibility\dataconversion\trust\ResendCertEmail::convertDataObject PHP Метод

convertDataObject() публичный Метод

public convertDataObject ( $dataObject, $newStructure = null )
    public function convertDataObject($dataObject, $newStructure = null)
    {
        $p = new parent();
        if (is_null($newStructure)) {
            $newStructure = $this->newStructure;
        }
        $newDataObject = $p->convertDataObject($dataObject, $newStructure);
        return $newDataObject;
    }

Usage Example

 /**
  * Valid conversion should complete with no
  * exception thrown.
  *
  *
  * @group validconversion
  */
 public function testValidDataConversion()
 {
     $data = json_decode(json_encode($this->validSubmission));
     $data->data->order_id = '123';
     $shouldMatchNewDataObject = new \stdClass();
     $shouldMatchNewDataObject->attributes = new \stdClass();
     $shouldMatchNewDataObject->attributes->order_id = $data->data->order_id;
     $pc = new ResendCertEmail();
     $newDataObject = $pc->convertDataObject($data);
     $this->assertTrue($newDataObject == $shouldMatchNewDataObject);
 }
ResendCertEmail