make changes according to refs #242

This commit is contained in:
2014-10-22 07:12:41 +02:00
parent cd2a7bff53
commit 2254acd8ee
20 changed files with 560 additions and 79 deletions

View File

@@ -25,7 +25,7 @@ class BlopEntity
/**
* @var array
*/
private $customField;
private $customField = array();
private $adress;
@@ -112,7 +112,7 @@ class BlopEntity
*
* @return BlopEntity
*/
public function setCustomField($customField)
public function setCustomField(array $customField)
{
$this->customField = $customField;
@@ -126,7 +126,8 @@ class BlopEntity
*/
public function getCustomField()
{
return $this->customField;
return $this->customField;
}
public function cfGet($key)

View File

@@ -16,6 +16,8 @@ class CustomField
* @var string
*/
private $label;
private $slug;
/**
* @var string
@@ -26,6 +28,17 @@ class CustomField
* @var boolean
*/
private $active;
private $options = array();
/**
*
* @var int
*/
private $relation = 1;
const ONE_TO_ONE = 1;
const ONE_TO_MANY = 2;
/**
@@ -37,8 +50,13 @@ class CustomField
{
return $this->id;
}
function getSlug()
{
return $this->slug;
}
/**
/**
* Set label
*
* @param string $label
@@ -48,10 +66,19 @@ class CustomField
public function setLabel($label)
{
$this->label = $label;
if ($this->slug === NULL) {
$this->slug = preg_replace('/[^A-Za-z0-9-]+/', '-', $label);
}
return $this;
}
function getOptions()
{
return $this->options;
}
/**
* Get label
*
@@ -85,7 +112,20 @@ class CustomField
{
return $this->type;
}
function getRelation()
{
return $this->relation;
}
function setRelation($relation)
{
$this->relation = $relation;
return $this;
}
/**
* Set active
*