Skip to content

Commit cce90da

Browse files
committed
get page info api resource
1 parent eb9bb99 commit cce90da

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

CmsSync/Model/Objectmodel/Api.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@ public function getBlockInfo($identifier)
4545
return false;
4646
}
4747

48+
/**
49+
* get page info
50+
* @param $identifier
51+
* @return bool|mixed
52+
*/
53+
public function getPageInfo($identifier)
54+
{
55+
if($this->isEnabled()){
56+
$pageModel = Mage::getModel('cms/page')->load($identifier, 'identifier');
57+
58+
if($pageModel){
59+
60+
return $pageModel->getData();
61+
}
62+
}
63+
return false;
64+
65+
}
66+
4867
/**
4968
* check if the block/page exists in remote
5069
* @param $identifier

CmsSync/Model/Page.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public function sync($pageId)
2828
$remotePage = $proxy->call($sessionId, 'cms_api.page_info', $pageModel->getIdentifier());// array of info for the remote block
2929

3030
if($remotePage){
31-
31+
echo 'update page';
3232
// update page
3333
$proxy->call($sessionId, 'cms_api.page_update', array($pageModel->getData()));
3434
}else{
35-
35+
echo 'create page';
3636
// create new block
3737
$proxy->call($sessionId, 'cms_api.page_create', array($pageModel->getData()));
3838
}

0 commit comments

Comments
 (0)