XMC: SubAtomic Object Collection

Deklarasi SubAtomicCollection
<?php

    class ObjectNameCollection extends \xmc\xmSubAtomicCollection
    {
        function  NewObject() { return new \atomic\ObjectMode\ObjectNamespace\ObjectName(); }
        function AutoRun($Param)
        { 
            $RST = "";
            if ($Param=="LIST.HEADER")
            {
            }
            return $RST;
        }
    }

?>
Cara mengambil data dari Database oleh Internal SubAtomicCollection
<?php
    
function InternalSubAtomicCollection($Param)
{ 
    $SQLFilter = "`table_name`.column_name='filter'";
    $this->SQLFilter($SQLFilter);
    $this->SQLOrder("`table_name`.column_name"); 
    $this->Query();
    foreach ($this->SubAtomic as $obj)        
    {
        // Process Data
    }
}

?>
Cara mengambil data dari Database melalui SubAtomicCollection
<?php

$objCol = xmUser::SubAtomic("atomic\\objectType\\ObjectName", true);

// Atau

xmUser::LoadSubAtomic("atomic\\objectType\\ObjectName");
$objCol = new \atomic\objectType\ObjectName();

// Atau

$objCol = xmSession::SubAtomic("atomic\\objectType\\ObjectName" , true);

// Atau

xmSession::LoadSubAtomic("atomic\\objectType\\ObjectName");
$objCol = new \atomic\objectType\ObjectName();


$SQLFilter = "`table_name`.column_name='filter'";
$objCol->SQLFilter($SQLFilter);
$objCol->SQLOrder("`table_name`.column_name"); 
$objCol->Query();
foreach ($objCol->SubAtomic as $obj)        
{
    // Process Data
}

?>

No comments:

Post a Comment