<?php

namespace MGModule\DNSManager2\models\testGroup\simpleItem;
use MGModule\DNSManager2 as main;

/**
 * Example Item Class
 * 
 * @Table(name=simple_item)
 * @author Michal Czech <michael@modulesgarden.com>
 */
class simpleItem extends main\mgLibs\models\orm{
    /**
     * ID field
     * 
     * @Column(id)
     * @var int 
     */
    public $id;
    
    /**
     *
     * @Column(varchar=32)
     * @var string
     */
    public $name;
    
    /**
     *
     * @var main\models\testGroup\testItem\testItem
     */
    private $_testItem;
    
    /**
     *
     * @Column(int,refrence=main\models\whmcs\clients::id)
     * @var int 
     */
    public $testItemID;
    
    public function gettestItem(){
        if(empty($this->_testItem))
        {
            $this->_testItem = new main\models\testGroup\testItem\testItem($this->testItemID);
        }
        
        return $this->_testItem;
    }
    
    public function settestItem(main\models\testGroup\testItem\testItem $item)
    {
        $this->_testItem = $item;
        $this->testItemID = $item->id;
    }
}
