#はじめに
EDI情報作成時に使ったロジックなので備忘録として残します。
#サンプルコード
class TestA
{
public function __construct()
{
$this->test1 = "00";
$this->test2 = " ";
$this->test3 = "00";
$this->test4 = " ";
$this->test5 = "GG";
}
public function getTest1()
{
return $this->test1;
}
public function setTest1($test1)
{
$this->test1 = $$test1;
return $this;
}
・・・(省略)
}
class TestB
{
$test;
public function build()
{
$this->setTest(new TestA());
$test = $this->getTest();
$testMessage = 'AAA'.'|'.
$test->getTest1().'|'.
$test->getTest2().'|'.
$test->getTest3().'|'.
$test->getTest4().'|'.
$test->getTest5();
var_dump($testMessage);
}
public function getTest()
{
return $this->test;
}
public function setTest()
{
$this->test = $test;
return $test;
}
#var_dumpの結果
"AAA|00| |00| |GG"