: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Model;
use Nextend\Framework\Database\AbstractPlatformConnectorTable;
use Nextend\Framework\Database\Database;
use Nextend\Framework\Plugin;
/** @var AbstractPlatformConnectorTable */
public static $tableSectionStorage;
public function __construct() {
self::$tableSectionStorage = Database::getTable("nextend2_section_storage");
public static function get($application, $section, $referenceKey = null) {
"application" => $application,
if ($referenceKey !== null) {
$attributes['referencekey'] = $referenceKey;
return self::$tableSectionStorage->findByAttributes($attributes);
public static function getById($id, $section = null) {
if (!isset($cache[$section])) {
$cache[$section] = array();
} else if (isset($cache[$section][$id])) {
return $cache[$section][$id];
$cache[$section][$id] = null;
Plugin::doAction($section, array(
if ($cache[$section][$id]) {
return $cache[$section][$id];
$cache[$section][$id] = self::$tableSectionStorage->findByAttributes(array(
if ($section && $cache[$section][$id]['section'] != $section) {
$cache[$section][$id] = null;
return $cache[$section][$id];
return $cache[$section][$id];
public static function getAll($application, $section, $referenceKey = null) {
"application" => $application,
if ($referenceKey !== null) {
$attributes['referencekey'] = $referenceKey;
$rows = self::$tableSectionStorage->findAllByAttributes($attributes, array(
Plugin::doAction($application . $section, array(
public static function add($application, $section, $referenceKey, $value, $isSystem = 0, $editable = 1) {
"application" => $application,
if ($referenceKey !== null) {
$row["referencekey"] = $referenceKey;
self::$tableSectionStorage->insert($row);
return self::$tableSectionStorage->insertId();
public static function set($application, $section, $referenceKey, $value, $isSystem = 0, $editable = 1) {
$result = self::getAll($application, $section, $referenceKey);
return self::add($application, $section, $referenceKey, $value, $isSystem, $editable);
"application" => $application,
if ($referenceKey !== null) {
$attributes['referencekey'] = $referenceKey;
self::$tableSectionStorage->update(array('value' => $value), $attributes);
public static function setById($id, $value) {
$result = self::getById($id);
if ($result !== null && $result['editable']) {
self::$tableSectionStorage->update(array('value' => $value), array(
public static function delete($application, $section, $referenceKey = null) {
"application" => $application,
if ($referenceKey !== null) {
$attributes['referencekey'] = $referenceKey;
self::$tableSectionStorage->deleteByAttributes($attributes);
public static function deleteById($id) {
self::$tableSectionStorage->deleteByAttributes(array(