Location: PHPKode > projects > ContentCMS > libraries/quick_plugin/quick_plugin_record.class.php
<?php
/* 
 * @package     ContentCMS
 * @author      Dan Goldsmith
 * @copyright   Dan Goldsmith 2012
 * @link        http://contentcms.d2g.org.uk/
 * @version     {SUBVERSION_BUILD_NUMBER}
 * 
 * @licence     MPL 2.0
 * 
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 
 *
 */
class quick_plugin_record
{
    protected $created    = null;
    protected $modified   = null;
    protected $fields     = null;
    
    public function __construct()
    {
        if($this->fields === null)
        {
            $this->fields = array();
        }
    }
    
    public function setCreated($datetime = null)
    {
        if($datetime === null)
        {
            $datetime = date("Y-m-d H:i:s");
        }
        $this->created = $datetime;
    }
    
    public function getCreated()
    {
        return $this->created;
    }
    
    public function setModified($datetime = null)
    {
        if($datetime === null)
        {
            $datetime = date("Y-m-d H:i:s");
        }
        $this->modified = $datetime;
    }
    
    public function getModified()
    {
        return $this->modified;
    }
    
    public function setFields($fields)
    {
        if(is_array($fields))
        {
            $this->fields = $fields;            
        }
    }
    
    public function setField($key,$value)
    {
        $this->fields[$key] = $value;
    }
    
    public function getFields()
    {
        return $this->fields;
    }
    
    public function getField($key)
    {
        if(array_key_exists($key, $this->fields))
        {
            return $this->fields[$key];
        }
        return null;
    }
    
}

?>
Return current item: ContentCMS