Example #1
0
     orderContent($cid[0], -1, $option);
     break;
 case 'orderdown':
     orderContent($cid[0], 1, $option);
     break;
 case 'showarchive':
     viewArchive($sectionid, $option);
     break;
 case 'movesect':
     moveSection($cid, $sectionid, $option);
     break;
 case 'movesectsave':
     moveSectionSave($cid, $sectionid, $option);
     break;
 case 'copy':
     copyItem($cid, $sectionid, $option);
     break;
 case 'copysave':
     copyItemSave($cid, $sectionid, $option);
     break;
 case 'resethits':
     resetHits();
     break;
 case 'accesspublic':
     accessMenu($cid[0], 0, $option, $client);
     break;
 case 'accessregistered':
     accessMenu($cid[0], 1, $option, $client);
     break;
 case 'accessspecial':
     accessMenu($cid[0], 2, $option, $client);
Example #2
0
<?php

require 'classes/ItemPrototype.php';
require 'classes/ItemManager.php';
require 'classes/DeepCopyItem.php';
require 'classes/ShallowCopyItem.php';
use prototype\classes\DeepCopyItem;
use prototype\classes\ItemManager;
use prototype\classes\ShallowCopyItem;
function copyItem(ItemManager $manager, $code)
{
    $item1 = $manager->create($code);
    $item2 = $manager->create($code);
    $item2->getDetail()->comment = '書き換え';
    $item1->printData();
    $item2->printData();
}
$manager = new ItemManager();
$item = new DeepCopyItem('AB001', 'アイテム1', 1000);
$detail = new stdClass();
$detail->comment = 'アイテム1のコメント';
$item->setDetail($detail);
$manager->registerItem($item);
$item = new ShallowCopyItem('AC002', 'アイテム2', 2000);
$detail = new stdClass();
$detail->comment = 'アイテム2のコメント';
$item->setDetail($detail);
$manager->registerItem($item);
copyItem($manager, 'AB001');
copyItem($manager, 'AC002');