HEX
Server: LiteSpeed
System: Linux s917.lon1.mysecurecloudhost.com 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: assibfaf (3034)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/assibfaf/www/prox-classes/Preference/UploadType.php
<?php
/**
 * @package    Proxim
 * @author     Davison Pro <davis@davisonpro.dev | https://davisonpro.dev>
 * @copyright  2019 Proxim
 * @version    1.5.0
 * @since      File available since Release 1.0.0
 */

namespace Proxim\Preference;

use Db;
use Proxim\Database\DbQuery;
use Proxim\ObjectModel;
use Proxim\Util\ArrayUtils;

/**
 * UploadType
 */
class UploadType extends ObjectModel
{
	/** @var $id UploadType ID */
    public $id;

    /** @var string title */
    public $title;

    /** @var int writer */
    public $writer = 0;

    /** @var int customer */
    public $customer = 0;

    /** @var int editor */
    public $editor = 0;
    
    /** @var string date_upd */
	public $date_upd;
	
	/** @var string date_add */
	public $date_add;
	
	/**
     * @see ObjectModel::$definition
     */
    public static $definition = array(
        'table' => 'upload_type',
        'primary' => 'upload_type_id',
        'fields' => array( 
            'title' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'size' => 255),
            'writer' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
            'customer' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
            'editor' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
			'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateOrNull'),
            'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
        ),
    );

    /**
     * constructor.
     *
     * @param null $id
     */
    public function __construct($id = null) {
        parent::__construct($id);
    }
    
    /**
     * Return upload types by site ID.
     *
     * @param bool $siteId
     *
     * @return array UploadTypes
     */
    public static function getUploadTypes()
    {
        $sql = new DbQuery();
        $sql->select('ut.*');
        $sql->from('upload_type', 'ut');
        $sql->orderBy('ut.upload_type_id ASC');

        $result = Db::getInstance()->executeS($sql);
        
        return $result;
    }
}