@@ -113,7 +113,7 @@ public function hook_response_data($method, $o, &$r = null, &$d = null) {
113113
114114 // check for global includes and assign them
115115 $ kyteLibraries = new \Kyte \Core \Model (KyteLibrary);
116- $ kyteLibraries ->retrieve ('include_all ' , 1 , false , null , false , [['field ' => 'id ' , 'direction ' => 'asc ' ]]);
116+ $ kyteLibraries ->retrieve ('include_all ' , 1 , false , null , [[ ' field ' => ' kyte_account ' , ' value ' => $ this -> account -> id ]] , [['field ' => 'id ' , 'direction ' => 'asc ' ]]);
117117 foreach ($ kyteLibraries ->objects as $ lib ) {
118118 if ($ lib ->include_all == 1 ) {
119119 $ assignment = new \Kyte \Core \ModelObject (KyteLibraryAssignment);
@@ -130,7 +130,7 @@ public function hook_response_data($method, $o, &$r = null, &$d = null) {
130130
131131 // check for global scripts and assign them
132132 $ kyteScripts = new \Kyte \Core \Model (KyteScript);
133- $ kyteScripts ->retrieve ('include_all ' , 1 , false , null , false , [['field ' => 'id ' , 'direction ' => 'asc ' ]]);
133+ $ kyteScripts ->retrieve ('include_all ' , 1 , false , null , [[ ' field ' => ' kyte_account ' , ' value ' => $ this -> account -> id ]] , [['field ' => 'id ' , 'direction ' => 'asc ' ]]);
134134 foreach ($ kyteScripts ->objects as $ script ) {
135135 if ($ script ->include_all == 1 ) {
136136 $ assignment = new \Kyte \Core \ModelObject (KyteScriptAssignment);
@@ -926,7 +926,7 @@ private function generateContentHash($data) {
926926 */
927927 private function findExistingContent ($ contentHash ) {
928928 $ content = new \Kyte \Core \ModelObject (KytePageVersionContent);
929- return $ content ->retrieve ('content_hash ' , $ contentHash ) ? $ content : null ;
929+ return $ content ->retrieve ('content_hash ' , $ contentHash, [[ ' field ' => ' kyte_account ' , ' value ' => $ this -> account -> id ]] ) ? $ content : null ;
930930 }
931931
932932 /**
@@ -958,7 +958,7 @@ private function storeVersionContent($contentHash, $data) {
958958 */
959959 private function incrementContentReference ($ contentHash ) {
960960 $ content = new \Kyte \Core \ModelObject (KytePageVersionContent);
961- if ($ content ->retrieve ('content_hash ' , $ contentHash )) {
961+ if ($ content ->retrieve ('content_hash ' , $ contentHash, [[ ' field ' => ' kyte_account ' , ' value ' => $ this -> account -> id ]] )) {
962962 $ content ->save ([
963963 'reference_count ' => $ content ->reference_count + 1 ,
964964 'last_referenced ' => time ()
@@ -1270,7 +1270,7 @@ public function cleanupOldVersions($pageId, $retentionPolicy = null) {
12701270 */
12711271 private function decrementContentReference ($ contentHash ) {
12721272 $ content = new \Kyte \Core \ModelObject (KytePageVersionContent);
1273- if ($ content ->retrieve ('content_hash ' , $ contentHash )) {
1273+ if ($ content ->retrieve ('content_hash ' , $ contentHash, [[ ' field ' => ' kyte_account ' , ' value ' => $ this -> account -> id ]] )) {
12741274 if ($ content ->reference_count <= 1 ) {
12751275 $ content ->delete ();
12761276 } else {
0 commit comments