: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Data;
public function __construct($data = null, $json = false) {
public function loadJSON($json) {
$array = json_decode($json, true);
if (is_array($array)) $this->_data = array_merge($this->_data, $array);
public function loadArray($array) {
if (!$this->_data) $this->_data = array();
if (is_array($array)) $this->_data = array_merge($this->_data, $array);
public function toJSON() {
return json_encode($this->_data);
public function toArray() {
return (array)$this->_data;
public function has($key) {
return isset($this->_data[$key]);
public function get($key, $default = '') {
if (isset($this->_data[$key])) return $this->_data[$key];
public function getIfEmpty($key, $default = '') {
if (isset($this->_data[$key]) && !empty($this->_data[$key])) return $this->_data[$key];
public function set($key, $value) {
$this->_data[$key] = $value;
public function un_set($key) {
if (isset($this->_data[$key])) {
unset($this->_data[$key]);
public function fillDefault($defaults) {
$this->_data = array_merge($defaults, $this->_data);