<?php

/**
 * @author Michal Prochazka
 */
class Vulnerability
{
    private $_id = -1;
    private $_name;
    private $_version;
    private $_release;
    private $_archId = -1;
    private $_osGroupId = -1;
    private $_operator;
    private $_cveDefId = -1;

    # Only getters - loaded from db [1:1] with 1 column
    private $_osGroupName;
    private $_archName;

    public function getVersionRelease()
    {
        if (!empty($this->_release)) {
            return $this->_version . "-" . $this->_release;
        } else {
            return $this->_version;
        }
    }

    public function getName()
    {
        return $this->_name;
    }

    public function setName($name)
    {
        $this->_name = $name;
    }

    public function getVersion()
    {
        return $this->_version;
    }

    public function setVersion($version)
    {
        $this->_version = $version;
    }

    public function getRelease()
    {
        return $this->_release;
    }

    public function setRelease($release)
    {
        $this->_release = $release;
    }

    public function getArchId()
    {
        return $this->_archId;
    }

    public function setArchId($archId)
    {
        $this->_archId = $archId;
    }

    public function getId()
    {
        return $this->_id;
    }

    public function setId($id)
    {
        $this->_id = $id;
    }

    public function getPkgId()
    {
        return $this->_pkgId;
    }

    public function setPkgId($pkgId)
    {
        $this->_pkgId = $pkgId;
    }

    public function getOsGroupId()
    {
        return $this->_osGroupId;
    }

    public function setOsGroupId($osGroupId)
    {
        $this->_osGroupId = $osGroupId;
    }

    public function getOperator()
    {
        return $this->_operator;
    }

    public function setOperator($operator)
    {
        $this->_operator = $operator;
    }

    public function getCveDefId()
    {
        return $this->_cveDefId;
    }

    public function setCveDefId($cveDefId)
    {
        $this->_cveDefId = $cveDefId;
    }

    # Extra

    public function getArchName()
    {
        return $this->_archName;
    }

    public function getOsGroupName()
    {
        return $this->_osGroupName;
    }
}
