Commit 83ba9e12 authored by François Agneray's avatar François Agneray
Browse files

AttributeAction => done

parent e0967e19
......@@ -269,47 +269,47 @@ class Attribute implements \JsonSerializable
$this->dataset = $dataset;
}
public function getId(): int
public function getId()
{
return $this->id;
}
public function getName(): string
public function getName()
{
return $this->name;
}
public function setName(string $name): void
public function setName($name)
{
$this->name = $name;
}
public function getTableName(): string
public function getTableName()
{
return $this->tableName;
}
public function setTableName(string $tableName): void
public function setTableName($tableName)
{
$this->tableName = $tableName;
}
public function getLabel(): string
public function getLabel()
{
return $this->label;
}
public function setLabel(string $label): void
public function setLabel($label)
{
$this->label = $label;
}
public function getFormLabel(): string
public function getFormLabel()
{
return $this->formLabel;
}
public function setFormLabel(string $formLabel): void
public function setFormLabel($formLabel)
{
$this->formLabel = $formLabel;
}
......@@ -319,27 +319,27 @@ class Attribute implements \JsonSerializable
return $this->description;
}
public function setDescription(string $description): void
public function setDescription($description)
{
$this->description = $description;
}
public function getOutputDisplay(): int
public function getOutputDisplay()
{
return $this->outputDisplay;
}
public function setOutputDisplay(int $outputDisplay): void
public function setOutputDisplay($outputDisplay)
{
$this->outputDisplay = $outputDisplay;
}
public function setCriteriaDisplay(int $criteriaDisplay): void
public function setCriteriaDisplay($criteriaDisplay)
{
$this->criteriaDisplay = $criteriaDisplay;
}
public function getCriteriaDisplay(): int
public function getCriteriaDisplay()
{
return $this->criteriaDisplay;
}
......@@ -349,7 +349,7 @@ class Attribute implements \JsonSerializable
return $this->searchFlag;
}
public function setSearchFlag(string $searchFlag): void
public function setSearchFlag($searchFlag)
{
$this->searchFlag = $searchFlag;
}
......@@ -359,7 +359,7 @@ class Attribute implements \JsonSerializable
return $this->searchType;
}
public function setSearchType(string $searchType): void
public function setSearchType($searchType)
{
$this->searchType = $searchType;
}
......@@ -369,17 +369,17 @@ class Attribute implements \JsonSerializable
return $this->operator;
}
public function setOperator(string $operator): void
public function setOperator($operator)
{
$this->operator = $operator;
}
public function getType(): string
public function getType()
{
return $this->type;
}
public function setType(string $type): void
public function setType($type)
{
$this->type = $type;
}
......@@ -389,7 +389,7 @@ class Attribute implements \JsonSerializable
return $this->min;
}
public function setMin(string $min): void
public function setMin($min)
{
$this->min = $min;
}
......@@ -399,7 +399,7 @@ class Attribute implements \JsonSerializable
return $this->max;
}
public function setMax(string $max): void
public function setMax($max)
{
$this->max = $max;
}
......@@ -409,7 +409,7 @@ class Attribute implements \JsonSerializable
return $this->placeholderMin;
}
public function setPlaceholderMin(string $placeholderMin): void
public function setPlaceholderMin($placeholderMin)
{
$this->placeholderMin = $placeholderMin;
}
......@@ -419,7 +419,7 @@ class Attribute implements \JsonSerializable
return $this->placeholderMax;
}
public function setPlaceholderMax(string $placeholderMax): void
public function setPlaceholderMax($placeholderMax)
{
$this->placeholderMax = $placeholderMax;
}
......@@ -429,7 +429,7 @@ class Attribute implements \JsonSerializable
return $this->uriAction;
}
public function setUriAction(string $uriAction): void
public function setUriAction($uriAction)
{
$this->uriAction = $uriAction;
}
......@@ -439,17 +439,17 @@ class Attribute implements \JsonSerializable
return $this->renderer;
}
public function setRenderer(string $renderer): void
public function setRenderer($renderer)
{
$this->renderer = $renderer;
}
public function getDisplayDetail(): int
public function getDisplayDetail()
{
return $this->displayDetail;
}
public function setDisplayDetail(int $displayDetail): void
public function setDisplayDetail($displayDetail)
{
$this->displayDetail = $displayDetail;
}
......@@ -459,7 +459,7 @@ class Attribute implements \JsonSerializable
return $this->voUtype;
}
public function setVoUtype(string $voUtype): void
public function setVoUtype($voUtype)
{
$this->voUtype = $voUtype;
}
......@@ -469,7 +469,7 @@ class Attribute implements \JsonSerializable
return $this->voUcd;
}
public function setVoUcd(string $voUcd): void
public function setVoUcd($voUcd)
{
$this->voUcd = $voUcd;
}
......@@ -479,7 +479,7 @@ class Attribute implements \JsonSerializable
return $this->voUnit;
}
public function setVoUnit(string $voUnit): void
public function setVoUnit($voUnit)
{
$this->voUnit = $voUnit;
}
......@@ -489,7 +489,7 @@ class Attribute implements \JsonSerializable
return $this->voDescription;
}
public function setVoDescription(string $voDescription): void
public function setVoDescription($voDescription)
{
$this->voDescription = $voDescription;
}
......@@ -499,7 +499,7 @@ class Attribute implements \JsonSerializable
return $this->voDatatype;
}
public function setVoDatatype(string $voDatatype): void
public function setVoDatatype($voDatatype)
{
$this->voDatatype = $voDatatype;
}
......@@ -509,17 +509,17 @@ class Attribute implements \JsonSerializable
return $this->voSize;
}
public function setVoSize(int $voSize): void
public function setVoSize($voSize)
{
$this->voSize = $voSize;
}
public function getSelected(): bool
public function getSelected()
{
return $this->selected;
}
public function setSelected(bool $selected): void
public function setSelected($selected)
{
$this->selected = $selected;
}
......@@ -529,17 +529,17 @@ class Attribute implements \JsonSerializable
return $this->orderBy;
}
public function setOrderBy(bool $orderBy): void
public function setOrderBy($orderBy)
{
$this->orderBy = $orderBy;
}
public function getOrderDisplay(): int
public function getOrderDisplay()
{
return $this->orderDisplay;
}
public function setOrderDisplay(int $orderDisplay): void
public function setOrderDisplay($orderDisplay)
{
$this->orderDisplay = $orderDisplay;
}
......@@ -549,7 +549,7 @@ class Attribute implements \JsonSerializable
return $this->detail;
}
public function setDetail(bool $detail): void
public function setDetail($detail)
{
$this->detail = $detail;
}
......@@ -559,7 +559,7 @@ class Attribute implements \JsonSerializable
return $this->rendererDetail;
}
public function setRendererDetail(string $rendererDetail): void
public function setRendererDetail($rendererDetail)
{
$this->rendererDetail = $rendererDetail;
}
......@@ -569,7 +569,7 @@ class Attribute implements \JsonSerializable
return $this->options;
}
public function setOptions(string $options): void
public function setOptions($options)
{
$this->options = $options;
}
......@@ -579,7 +579,7 @@ class Attribute implements \JsonSerializable
return $this->criteriaFamily;
}
public function setCriteriaFamily(CriteriaFamily $criteriaFamily): void
public function setCriteriaFamily($criteriaFamily)
{
$this->criteriaFamily = $criteriaFamily;
}
......@@ -589,7 +589,7 @@ class Attribute implements \JsonSerializable
return $this->outputCategory;
}
public function setOutputCategory(OutputCategory $outputCategory): void
public function setOutputCategory($outputCategory)
{
$this->outputCategory = $outputCategory;
}
......
......@@ -71,8 +71,6 @@ final class AttributeActionTest extends TestCase
public function testEditADatabase(): void
{
$this->addAnAttribute();
$this->addCriteriaFamily();
$this->addOutputCategory();
$fields = $this->getEditAttributeFields();
$request = $this->getRequest('PUT')->withParsedBody($fields);
$response = ($this->action)($request, new Response(), array('name' => 'obs_cat', 'id' => 1));
......@@ -173,7 +171,9 @@ final class AttributeActionTest extends TestCase
private function addDatasetFamily(): DatasetFamily
{
$family = new DatasetFamily();
$instance = $this->addInstance();
$family = new DatasetFamily($instance);
$family->setLabel('Default dataset');
$family->setDisplay(10);
$this->entityManager->persist($family);
......@@ -181,9 +181,9 @@ final class AttributeActionTest extends TestCase
return $family;
}
private function addCriteriaFamily(): CriteriaFamily
private function addCriteriaFamily(Dataset $dataset): CriteriaFamily
{
$family = new CriteriaFamily();
$family = new CriteriaFamily($dataset);
$family->setLabel('Default criteria');
$family->setDisplay(10);
$this->entityManager->persist($family);
......@@ -192,9 +192,9 @@ final class AttributeActionTest extends TestCase
return $family;
}
private function addOutputCategory(): OutputCategory
private function addOutputCategory(Dataset $dataset): OutputCategory
{
$outputFamily = $this->addOutputFamily();
$outputFamily = $this->addOutputFamily($dataset);
$outputCategory = new OutputCategory();
$outputCategory->setLabel('Default output category');
......@@ -205,9 +205,9 @@ final class AttributeActionTest extends TestCase
return $outputCategory;
}
private function addOutputFamily(): OutputFamily
private function addOutputFamily(Dataset $dataset): OutputFamily
{
$family = new OutputFamily();
$family = new OutputFamily($dataset);
$family->setLabel('Default output');
$family->setDisplay(10);
$this->entityManager->persist($family);
......@@ -218,7 +218,6 @@ final class AttributeActionTest extends TestCase
private function addADataset(): Dataset
{
$project = $this->addProject();
$instance = $this->addInstance();
$family = $this->addDatasetFamily();
$dataset = new Dataset('obs_cat');
......@@ -231,7 +230,6 @@ final class AttributeActionTest extends TestCase
$dataset->setDataPath('/mnt/obs_cat');
$dataset->setSelectableRow(false);
$dataset->setProject($project);
$dataset->setInstance($instance);
$dataset->setDatasetFamily($family);
$this->entityManager->persist($dataset);
$this->entityManager->flush();
......@@ -243,6 +241,9 @@ final class AttributeActionTest extends TestCase
{
$dataset = $this->addADataset();
$this->addCriteriaFamily($dataset);
$this->addOutputCategory($dataset);
$attribute = new Attribute(1, $dataset);
$attribute->setName('id');
$attribute->setTableName($dataset->getTableRef());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment