HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/NVonken/mijneigenlied.com/wwwroot/Core/Domain/File.php
<?php

class File extends BaseClass
{

    ////////////////
    // Properties //
    ////////////////

    public $Id;
    public $Name;
    public $Extension;
    public $Created;
    public $Modified;

    public static $_primaryKey = array("Id");

    /*
    * Public methods
    */

    /**
     * Inserts a file
     */
    public function Insert()
    {
        $this->Created = microtime(true);
        $this->Modified = microtime(true);
        return (int)parent::Insert($this);
    }

    /**
     * Updates an file
     */
    public function Update()
    {
        $this->Modified = microtime(true);
        parent::Update();
    }

    /**
     * Selects an file by id
     * @static
     * @param int $id
     * @return file
     */
    public static function Select($id)
    {
        return parent::Select(intval($id));
    }

    /**
     * Selects all filees
     * @static
     * @return file[]
     */
    public static function SelectAll()
    {
        return parent::SelectAll();
    }

    /**
     * Deletes a file
     */
    public function Delete()
    {
        parent::Delete();
    }

    /**
     * Selects files by filename
     * @static
     * @param string $fileName
     * @return File
     */
    public static function SelectByName($fileName)
    {
        return reset(parent::SelectObjects("SELECT *
                                            FROM `File`
                                            WHERE Name = '" . parent::_db()->escape($fileName) . "'"));
    }

    /**
     * Checks for existing file names
     * @static
     * @param string $fileName
     * @return File[]
     */
    public static function FindName($fileName)
    {
        return parent::SelectObjects("SELECT *
                                            FROM `File`
                                            WHERE Name LIKE '%" . parent::_db()->escape($fileName) . "%'");
    }
}

?>