15. trait XmlConversion {
public function toXml() {
$xml = new SimpleXMLElement('<object></object>');
foreach($this->getXmlAttributes() as $attribute) {
$xml->addChild(new ...)
}
return $xml->asXml();
}
abstract protected function getXmlAttributes();
}
class Person {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
class Log {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
16. trait XmlConversion {
public function toXml() {
$xml = new SimpleXMLElement('<object></object>');
foreach($this->getXmlAttributes() as $attribute) {
$xml->addChild(new ...)
}
return $xml->asXml();
}
abstract protected function getXmlAttributes();
}
class Person {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
class Log {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
17. trait XmlConversion {
public function toXml() {
$xml = new SimpleXMLElement('<object></object>');
foreach($this->getXmlAttributes() as $attribute) {
$xml->addChild(new ...)
}
return $xml->asXml();
}
abstract protected function getXmlAttributes();
}
class Person {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
class Log {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
18. trait XmlConversion {
public function toXml() {
$xml = new SimpleXMLElement('<object></object>');
foreach($this->getXmlAttributes() as $attribute) {
$xml->addChild(new ...)
}
return $xml->asXml();
}
abstract protected function getXmlAttributes();
}
class Person {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
class Log {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
19. trait XmlConversion {
public function toXml() {
$xml = new SimpleXMLElement('<object></object>');
foreach($this->getXmlAttributes() as $attribute) {
$xml->addChild(new ...)
}
return $xml->asXml();
}
abstract protected function getXmlAttributes();
}
class Person {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
class Log {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
20. trait XmlConversion {
public function toXml() {
$xml = new SimpleXMLElement('<object></object>');
foreach($this->getXmlAttributes() as $attribute) {
$xml->addChild(new ...)
}
return $xml->asXml();
}
abstract protected function getXmlAttributes();
}
class Person {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
class Log {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
21. trait XmlConversion {
public function toXml() {
$xml = new SimpleXMLElement('<object></object>');
foreach($this->getXmlAttributes() as $attribute) {
$xml->addChild(new ...)
}
return $xml->asXml();
}
abstract protected function getXmlAttributes();
}
class Person {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
class Log {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
22. trait XmlConversion {
public function toXml() {
$xml = new SimpleXMLElement('<object></object>');
foreach($this->getXmlAttributes() as $attribute) {
$xml->addChild(new ...)
}
return $xml->asXml();
}
abstract protected function getXmlAttributes();
}
class Person {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
class Log {
use XmlConversion;
protected function getXmlAttributes() {
return ...
}
}
$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();