Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
8 / 8 |
CRAP | |
100.00% |
14 / 14 |
| XMLCollection | |
100.00% |
1 / 1 |
|
100.00% |
8 / 8 |
8 | |
100.00% |
14 / 14 |
| __construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| fromXML | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
|||
| getName | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setName | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getForeignTable | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setForeignTable | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getForeignReferenceName | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setForeignReferenceName | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| <?php | |
| declare(strict_types = 1); | |
| namespace Siesta\XML; | |
| /** | |
| * @author Gregor Müller | |
| */ | |
| class XMLCollection | |
| { | |
| const ELEMENT_COLLECTION_NAME = "collection"; | |
| const NAME = "name"; | |
| const FOREIGN_TABLE = "foreignTable"; | |
| const FOREIGN_REFERENCE_NAME = "foreignReferenceName"; | |
| /** | |
| * @var string | |
| */ | |
| protected $name; | |
| /** | |
| * @var string | |
| */ | |
| protected $foreignTable; | |
| /** | |
| * @var string | |
| */ | |
| protected $foreignReferenceName; | |
| /** | |
| * XMLCollection constructor. | |
| */ | |
| public function __construct() | |
| { | |
| } | |
| /** | |
| * @param XMLAccess $xmlAccess | |
| */ | |
| public function fromXML(XMLAccess $xmlAccess) | |
| { | |
| $this->setName($xmlAccess->getAttribute(self::NAME)); | |
| $this->setForeignReferenceName($xmlAccess->getAttribute(self::FOREIGN_REFERENCE_NAME)); | |
| $this->setForeignTable($xmlAccess->getAttribute(self::FOREIGN_TABLE)); | |
| } | |
| /** | |
| * @return string | |
| */ | |
| public function getName() | |
| { | |
| return $this->name; | |
| } | |
| /** | |
| * @param string $name | |
| */ | |
| public function setName($name) | |
| { | |
| $this->name = $name; | |
| } | |
| /** | |
| * @return string | |
| */ | |
| public function getForeignTable() | |
| { | |
| return $this->foreignTable; | |
| } | |
| /** | |
| * @param string $foreignTable | |
| */ | |
| public function setForeignTable($foreignTable) | |
| { | |
| $this->foreignTable = $foreignTable; | |
| } | |
| /** | |
| * @return string | |
| */ | |
| public function getForeignReferenceName() | |
| { | |
| return $this->foreignReferenceName; | |
| } | |
| /** | |
| * @param string $foreignReferenceName | |
| */ | |
| public function setForeignReferenceName($foreignReferenceName) | |
| { | |
| $this->foreignReferenceName = $foreignReferenceName; | |
| } | |
| } |