@@ 69-76 (lines=8) @@ | ||
66 | * @param \stdClass $stdClass |
|
67 | * @internal public 이 아닌 protected 로 변경필요 |
|
68 | */ |
|
69 | public function importFromStdClass($stdClass) |
|
70 | { |
|
71 | $reflect = new ReflectionClass(get_called_class()); |
|
72 | $properties = $reflect->getDefaultProperties(); |
|
73 | foreach ($properties as $key => $value) { |
|
74 | $this->{$key} = $stdClass->{$key}; |
|
75 | } |
|
76 | } |
|
77 | ||
78 | /**interface의 function을 가져와 클래스를 초기화 한다. |
|
79 | * @param $reader |
|
@@ 82-91 (lines=10) @@ | ||
79 | * @param $reader |
|
80 | * @deprecated UniversalBookReader 를 상속받아 구현할것 |
|
81 | */ |
|
82 | public function importFromInterface($reader) |
|
83 | { |
|
84 | $reflect = new ReflectionClass(get_called_class()); |
|
85 | $default_properties = $reflect->getDefaultProperties(); |
|
86 | foreach ($default_properties as $key => $value) { |
|
87 | if (method_exists($reader, $key)) { |
|
88 | $this->{$key} = $reader->$key(); |
|
89 | } |
|
90 | } |
|
91 | } |
|
92 | ||
93 | /** |
|
94 | * 배열을 이용하여 클래스를 초기화한다 |