예제 #1
0
 public function fromStdObj(stdClass $obj)
 {
     foreach ($obj->storage as $item) {
         $this->add(Item::fromStdObj($item));
     }
     return $this;
 }
예제 #2
0
파일: Item.php 프로젝트: UntamedWorlds/cart
 public function testFromStdObj()
 {
     $json = json_encode($this->item);
     $this->assertEquals($this->item, ItemInstance::fromStdObj(json_decode($json)));
 }