Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/smart-sl.../Nextend/Framewor.../Model
File: ApplicationSection.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Nextend\Framework\Model;
[2] Fix | Delete
[3] Fix | Delete
class ApplicationSection {
[4] Fix | Delete
[5] Fix | Delete
private $application = 'system';
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Quick cache implementation to prevent duplicate queries. It might have bugs.
[9] Fix | Delete
*
[10] Fix | Delete
* @var array
[11] Fix | Delete
*/
[12] Fix | Delete
protected $cache = array();
[13] Fix | Delete
[14] Fix | Delete
public function __construct($application) {
[15] Fix | Delete
$this->application = $application;
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
public function getById($id, $section) {
[19] Fix | Delete
return Section::getById($id, $section);
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
public function setById($id, $value) {
[23] Fix | Delete
$this->cache = array();
[24] Fix | Delete
[25] Fix | Delete
return Section::setById($id, $value);
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
public function get($section, $referenceKey = null, $default = null) {
[29] Fix | Delete
[30] Fix | Delete
if (isset($this->cache[$section . '///' . $referenceKey])) {
[31] Fix | Delete
return $this->cache[$section . '///' . $referenceKey];
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
$attributes = array(
[35] Fix | Delete
"application" => $this->application,
[36] Fix | Delete
"section" => $section
[37] Fix | Delete
);
[38] Fix | Delete
[39] Fix | Delete
if ($referenceKey !== null) {
[40] Fix | Delete
$attributes['referencekey'] = $referenceKey;
[41] Fix | Delete
}
[42] Fix | Delete
$result = Section::$tableSectionStorage->findByAttributes($attributes);
[43] Fix | Delete
if (is_array($result)) {
[44] Fix | Delete
$this->cache[$section . '///' . $referenceKey] = $result['value'];
[45] Fix | Delete
[46] Fix | Delete
return $result['value'];
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
return $default;
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
public function getAll($section, $referenceKey = null) {
[53] Fix | Delete
return Section::getAll($this->application, $section, $referenceKey);
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
public function set($section, $referenceKey, $value) {
[57] Fix | Delete
if (isset($this->cache[$section . '///' . $referenceKey])) {
[58] Fix | Delete
unset($this->cache[$section . '///' . $referenceKey]);
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
Section::set($this->application, $section, $referenceKey, $value);
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
public function add($section, $referenceKey, $value) {
[65] Fix | Delete
if (isset($this->cache[$section . '///' . $referenceKey])) {
[66] Fix | Delete
unset($this->cache[$section . '///' . $referenceKey]);
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
return Section::add($this->application, $section, $referenceKey, $value);
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
public function delete($section, $referenceKey = null) {
[73] Fix | Delete
if (isset($this->cache[$section . '///' . $referenceKey])) {
[74] Fix | Delete
unset($this->cache[$section . '///' . $referenceKey]);
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
return Section::delete($this->application, $section, $referenceKey);
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
public function deleteById($id) {
[81] Fix | Delete
return Section::deleteById($id);
[82] Fix | Delete
}
[83] Fix | Delete
}
[84] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function