Commit 1ec4539c by Van

feat(all): change

parent 8a127c1e
...@@ -54,7 +54,7 @@ class FluxType extends AbstractType ...@@ -54,7 +54,7 @@ class FluxType extends AbstractType
] ]
]) ])
->add( ->add(
'flux_keys', 'keys',
KeyType::class, KeyType::class,
[ [
'label' => false, 'label' => false,
......
...@@ -18,7 +18,7 @@ class Flux extends Entity ...@@ -18,7 +18,7 @@ class Flux extends Entity
/** @var string */ /** @var string */
protected $code; protected $code;
/** @var array */ /** @var array */
protected $flux_keys; protected $keys;
/** @var string */ /** @var string */
protected $contentType; protected $contentType;
...@@ -89,18 +89,18 @@ class Flux extends Entity ...@@ -89,18 +89,18 @@ class Flux extends Entity
/** /**
* @return array * @return array
*/ */
public function getFluxKeys() public function getKeys()
{ {
return $this->flux_keys; return $this->keys;
} }
/** /**
* @param $flux_keys * @param array $keys
* @return Flux * @return Flux
*/ */
public function setFluxKeys($flux_keys) public function setKeys($keys)
{ {
$this->flux_keys = $flux_keys; $this->keys = $keys;
return $this; return $this;
} }
......
...@@ -15,7 +15,7 @@ class Flux extends BaseTable ...@@ -15,7 +15,7 @@ class Flux extends BaseTable
$this->table->addColumn('id', 'integer', ['autoincrement' => true]); $this->table->addColumn('id', 'integer', ['autoincrement' => true]);
$this->table->addColumn('title', 'string', ['notnull' => true]); $this->table->addColumn('title', 'string', ['notnull' => true]);
$this->table->addColumn('code', 'string', ['notnull' => true]); $this->table->addColumn('code', 'string', ['notnull' => true]);
$this->table->addColumn('flux_keys', 'json_array', ['notnull' => true]); $this->table->addColumn('keys', 'json_array', ['notnull' => true]);
$this->table->addColumn('contentType', 'string', ['notnull' => true]); $this->table->addColumn('contentType', 'string', ['notnull' => true]);
$this->table->addColumn('viewless', 'boolean', ['default' => false]); $this->table->addColumn('viewless', 'boolean', ['default' => false]);
$this->table->addColumn('searchable', 'boolean', ['default' => true]); $this->table->addColumn('searchable', 'boolean', ['default' => true]);
...@@ -30,7 +30,7 @@ class Flux extends BaseTable ...@@ -30,7 +30,7 @@ class Flux extends BaseTable
*/ */
protected function addIndexes() protected function addIndexes()
{ {
/*$this->table->addIndex(['flux_keys']);*/ $this->table->addIndex(['keys']);
$this->table->addIndex(['id']); $this->table->addIndex(['id']);
} }
......
...@@ -12,7 +12,7 @@ class ContentTypeFile ...@@ -12,7 +12,7 @@ class ContentTypeFile
/** /**
* @var array * @var array
*/ */
private $flux_keys; private $keys;
/** /**
* @var Application * @var Application
*/ */
...@@ -39,7 +39,7 @@ class ContentTypeFile ...@@ -39,7 +39,7 @@ class ContentTypeFile
if(empty($flux->getCode()) || empty($flux->getContentType())) { if(empty($flux->getCode()) || empty($flux->getContentType())) {
throw new \Exception('Le flux est invalide.'); throw new \Exception('Le flux est invalide.');
} }
$this->flux_keys = $keys; $this->keys = $keys;
$this->application = $application; $this->application = $application;
$this->options = $options; $this->options = $options;
$this->flux = $flux; $this->flux = $flux;
...@@ -88,7 +88,7 @@ class ContentTypeFile ...@@ -88,7 +88,7 @@ class ContentTypeFile
'group' => 'content' 'group' => 'content'
]; ];
foreach ($this->flux_keys as $key) { foreach ($this->keys as $key) {
$fields[strtolower($key)] = [ $fields[strtolower($key)] = [
'type' => 'text', 'type' => 'text',
'label' => $this->getFieldLabel($key), 'label' => $this->getFieldLabel($key),
......
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