Skip to content
Snippets Groups Projects
Commit babc062b authored by damjan's avatar damjan
Browse files

[TASK] Use IDs instead of objects

parent 3559692e
No related branches found
No related tags found
No related merge requests found
......@@ -55,12 +55,12 @@ class Attribute {
private $typo3Group = Attribute::NORMAL_GROUP;
/**
* @var Attribute
* @var int
*/
private $type;
/**
* @var Attribute
* @var int
*/
private $parent;
......@@ -204,7 +204,7 @@ class Attribute {
/**
* Set parent
*
* @param Attribute $parent
* @param int $parent
* @return Attribute
*/
public function setParent($parent) {
......@@ -214,9 +214,9 @@ class Attribute {
}
/**
* Get parent
* Get parent id.
*
* @return Attribute
* @return int
*/
public function getParent() {
return $this->parent;
......@@ -295,14 +295,14 @@ class Attribute {
}
/**
* @return Attribute
* @return int
*/
public function getType() {
return $this->type;
}
/**
* @param Attribute $type
* @param int $type
* @return Attribute
*/
public function setType($type) {
......@@ -354,10 +354,10 @@ class Attribute {
$attributeArray ['maxVersion'] = $this->maxVersion;
}
if (isset($this->parent)) {
$attributeArray ['parent'] = $this->parent->getId();
$attributeArray ['parent'] = $this->parent;
}
if (isset($this->type)) {
$attributeArray ['type'] = $this->type->getId();
$attributeArray ['type'] = $this->type;
}
if (isset($this->typo3Group)) {
$attributeArray ['typo3Group'] = $this->typo3Group;
......@@ -408,14 +408,12 @@ class Attribute {
$this->maxVersion = NULL;
}
if (isset($attribute->parent)) {
$this->parent = new Attribute();
$this->parent->setId($attribute->parent);
$this->parent = $attribute->parent;
} else {
$this->parent = NULL;
}
if (isset($attribute->type)) {
$this->type = new Attribute();
$this->type->setId($attribute->type);
$this->type = $attribute->type;
} else {
$this->type = NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment