|
|
@@ -149,25 +149,15 @@ class BxDolPageQuery extends BxDolDb
|
|
|
|
|
|
return $this->getOne("SELECT `data` FROM `sys_pages_blocks_data` WHERE `block_id` = :block_id" . $sWhereClause, $aBindings);
|
|
|
}
|
|
|
-
|
|
|
- public function setPageBlockData($iBlockId, $mixedData, $iContentId = 0, $sContentModule = '')
|
|
|
+
|
|
|
+ public function setPageBlockData($iBlockId, $iContentId = 0, $sContentModule = '', $mixedData = '')
|
|
|
{
|
|
|
- $aBindings = [
|
|
|
+ return $this->query("INSERT INTO `sys_pages_blocks_data` (`block_id`, `content_id`, `content_module`, `data`) VALUES (:block_id, :content_id, :content_module, :data) ON DUPLICATE KEY UPDATE `data` = :data", [
|
|
|
'block_id' => $iBlockId,
|
|
|
+ 'content_id' => $iContentId,
|
|
|
+ 'content_module' => $sContentModule,
|
|
|
'data' => is_array($mixedData) ? json_encode($mixedData) : $mixedData
|
|
|
- ];
|
|
|
-
|
|
|
- $sWhereClause = "";
|
|
|
- if(!empty($iContentId) && !empty($sContentModule)) {
|
|
|
- $aBindings = array_merge($aBindings, [
|
|
|
- 'content_id' => $iContentId,
|
|
|
- 'content_module' => $sContentModule
|
|
|
- ]);
|
|
|
-
|
|
|
- $sWhereClause .= " AND `content_id` = :content_id AND `content_module` = :content_module";
|
|
|
- }
|
|
|
-
|
|
|
- return $this->query("UPDATE `sys_pages_blocks_data` SET `data` = :data WHERE `block_id` = :block_id" . $sWhereClause, $aBindings);
|
|
|
+ ]);
|
|
|
}
|
|
|
|
|
|
public function getPageBlockContent($iId)
|