From 185341673d6eb1eca93d73c0cef4d90e0cfc0e86 Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 24 May 2019 14:52:09 +0300 Subject: [PATCH] Slim Framework integration #118 #117 - Fieldsets updates --- flextype/Fieldsets.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flextype/Fieldsets.php b/flextype/Fieldsets.php index e46cf0b5..0d306efe 100644 --- a/flextype/Fieldsets.php +++ b/flextype/Fieldsets.php @@ -76,15 +76,15 @@ class Fieldsets * * @access public * @param string $fieldset Fieldset - * @param string $data Data + * @param array $data Data * @return bool True on success, false on failure. */ - public function update(string $fieldset, string $data) : bool + public function update(string $fieldset, array $data) : bool { $fieldset_file = $this->_file_location($fieldset); if (Filesystem::has($fieldset_file)) { - return Filesystem::write($fieldset_file, $data); + return Filesystem::write($fieldset_file, JsonParser::encode($data)); } else { return false; } @@ -95,16 +95,16 @@ class Fieldsets * * @access public * @param string $fieldset Fieldset - * @param string $data Data + * @param array $data Data * @return bool True on success, false on failure. */ - public function create(string $fieldset, string $data = '') : bool + public function create(string $fieldset, array $data) : bool { $fieldset_file = $this->_file_location($fieldset); // Check if new entry file exists if (!Filesystem::has($fieldset_file)) { - return Filesystem::write($fieldset_file, $data); + return Filesystem::write($fieldset_file, JsonParser::encode($data)); } else { return false; }