forked from koala-framework/koala-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Generator.php
30 lines (25 loc) · 1.01 KB
/
Generator.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
class Kwc_List_ChildPages_Teaser_Generator extends Kwf_Component_Generator_Table
{
protected $_hasNumericIds = false;
protected $_idColumn = 'child_id';
protected $_useComponentId = true;
protected function _formatConfig($parentData, $row)
{
$ret = parent::_formatConfig($parentData, $row);
$ret['targetPage'] = Kwf_Component_Data_Root::getInstance()
->getComponentByDbId($row->target_page_id, array('subroot'=>$parentData, 'limit'=>1));
if (!$ret['targetPage']) return null; //can happen if page was deleted but entry still exists
return $ret;
}
public function getDuplicateProgressSteps($source)
{
return 0;
}
public function duplicateChild($source, $parentTarget, Zend_ProgressBar $progressBar = null)
{
//don't duplicate children of this generator *here* because we don't know the new child ids yet
//as they depend on the new pages (that might not yet exist at this point)
return null;
}
}