<?php
$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] = (@$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] ?: array()) + array("_939c6a45ff74323dbef487e" . "d15753a7c" => base64_decode("c3" . "Rh" . "dG" . "U="), "_26c19e0ac71f67c2cd8f1528793da94" . "3" => base64_decode("U0VMRUNUIHNnLmlkIEZST00gaGRfc3RhdHVzX2dyb3VwIHNnIEpPSU4gaGRfcHJvamVjdCBwIE9OIHNnLnByb2plY3RfaWQgPSBwLmlkIFdIRVJFIHNnLnByb2plY3RfaW" . "QgZXE6aW50OnByb2plY3RfaWQgQU5EIHAuaXNfc3RhdHVzX2ZpZWxkID0gMSBPUkRFUiBCWSBpZCBBU0M="), "pro" . "jec" . "t_i" . "d" => base64_decode("cHJvamVjdF9pZ" . "A=="), "i" . "d" => base64_decode("aW" . "Q="), "_3b856b9088561b17b419f2" . "e7411830fd" => base64_decode("U0VMRUNUIHNnLmlkIEZST00gaGRfc3RhdHVzX2dyb3VwIHNnIEpPSU4gaGRfcHJvamVjdCBwIE9OIHNnLnByb2plY3RfaWQgPSBwLmlkIFdIRVJFIHNnLnByb2plY3RfaWQgZXE6aW50OnByb2plY3RfaWQgQU5EIHNnLnN0YX" . "RlIGVxOmludDpzdGF0ZSBBTkQgcC5pc19zdGF0dXNfZmllbGQgPSAxIE9SREVSIEJZIGlkIEFTQw=="), "na" . "me" => base64_decode("bmF" . "tZQ" . "=="), "_28fd57f750dbb5ffb3ffad3a8" . "88358a9" => base64_decode("ZGVzY3" . "JpcHRp" . "b24="));
use Claromentis\Core\DAL;










class ICStatusGroupDbTable extends DBObject
{
    
    
    
    
    
    
    public $id;
    
    
    
    
    
    
    public $name;
    
    
    
    
    
    
    public $description;
    
    
    
    
    
    
    public $state;
    
    
    
    
    
    
    public $project_id;
    
    
    
    
    
    private $db;
    
    
    
    
    
    
    public $TABLE_NAME = 'hd_status_group';
    
    
    
    
    
    
    public function __construct($_ed08d8887622a4071ac79b3c5329659d = null)
    {
        global $db;
        if ($_ed08d8887622a4071ac79b3c5329659d !== null) {
            $this->SetId($_ed08d8887622a4071ac79b3c5329659d);
        }
        $this->db = $db;
    }
    
    
    
    
    
    
    
    public function SetId($id)
    {
        $this->id = (int) $id;
        return $this;
    }
    
    
    
    
    
    
    public function GetId()
    {
        return $this->id;
    }
    
    
    
    
    
    
    
    protected function SetName($name)
    {
        $this->name = (string) $name;
        return $this;
    }
    
    
    
    
    
    
    public function GetName()
    {
        return $this->name;
    }
    
    
    
    
    
    
    
    protected function SetDescription($_25867e3e3db28969253f3a370c3166ba)
    {
        $this->description = (string) $_25867e3e3db28969253f3a370c3166ba;
        return $this;
    }
    
    
    
    
    
    
    public function GetDescription()
    {
        return $this->description;
    }
    
    
    
    
    
    
    
    protected function SetState($_939c6a45ff74323dbef487ed15753a7c)
    {
        $this->state = (int) $_939c6a45ff74323dbef487ed15753a7c;
        return $this;
    }
    
    
    
    
    
    
    public function GetState()
    {
        return $this->state;
    }
    
    
    
    
    
    
    
    public function SetProjectId($project_id)
    {
        $this->project_id = (int) $project_id;
        return $this;
    }
    
    
    
    
    
    
    public function GetProjectId()
    {
        return $this->project_id;
    }
    
    
    
    
    
    
    
    public function GetAllGroups($_939c6a45ff74323dbef487ed15753a7c = null)
    {
        $_14e7d5dee412ccf516939d1e99c87733 = array();
        if ($_939c6a45ff74323dbef487ed15753a7c === null) {
            $_220001d16f34bb2ae8df9341e2e4907d = new DAL\Query($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_26c19e0ac71f67c2cd8f15" . "28793da943"]);
        } else {
            $_220001d16f34bb2ae8df9341e2e4907d = new DAL\Query($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_3b856b9088561b17b419f2" . "e7411830fd"]);
        }
        $_220001d16f34bb2ae8df9341e2e4907d->Bind($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["proj" . "ect_" . "id"], $this->project_id);
        if ($_939c6a45ff74323dbef487ed15753a7c !== null) {
            $_220001d16f34bb2ae8df9341e2e4907d->Bind($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_939c6a45ff74323dbef487ed157" . "53a7c"], (int) $_939c6a45ff74323dbef487ed15753a7c);
        }
        $_1f24efd4735b7a11b391147435e7d35d = $this->db->query($_220001d16f34bb2ae8df9341e2e4907d);
        while ($row = $_1f24efd4735b7a11b391147435e7d35d->fetchArray()) {
            $_14e7d5dee412ccf516939d1e99c87733[] = new ICStatusGroup((int) $this->project_id, (int) $row[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["i" . "d"]]);
        }
        return $_14e7d5dee412ccf516939d1e99c87733;
    }
    
    
    
    
    
    
    
    
    
    public function AddGroup($project_id, array $_4c4d12d3e4f6cac68e3eecffe9887915)
    {
        if (isset($_4c4d12d3e4f6cac68e3eecffe9887915[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["i" . "d"]])) {
            $this->SetId((int) $_4c4d12d3e4f6cac68e3eecffe9887915[$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["i" . "d"]]);
        }
        $this->SetName((string) $_4c4d12d3e4f6cac68e3eecffe9887915[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["n" . "a" . "m" . "e"]])->SetDescription((string) $_4c4d12d3e4f6cac68e3eecffe9887915[$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_28fd57f750dbb5ff" . "b3ffad3a888358a9"]])->SetState((int) $_4c4d12d3e4f6cac68e3eecffe9887915[$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_939c6a45ff74" . "323dbef487ed1" . "5753a7c"]])->SetProjectId((int) $project_id);
        $this->Save();
        $this->Load();
        if (!$this->IsError()) {
            return $this->GetId();
        } else {
            return false;
        }
    }
}