<?php

/*
 * Gestion des pièces jointes
 *
 *
 */
class Attachement
{

    protected $parentdocnumber;

    protected $parentdoctype;

    protected $doctype;

    protected $attachementlist;

    protected $exists;

    protected $con;

    protected $error;

    function __construct($docnumber = 0, $doctype = '')
    {
        $this->setParentDocNumber($docnumber);
        $this->setParentDocType($doctype);
    }

    public function SetParentDocNumber($doc = 0)
    {
        if ($doc != '')
            $this->parentdocnumber = $doc;
        else
            unset($this->parentdocnumber);
    }

    public function &getParentDocNumber()
    {
        return $this->parentdocnumber;
    }

    public function setParentDocType($type = '')
    {
        if ($type != '')
            $this->parentdoctype = $type;
        else
            unset($this->parentdoctype);
    }

    public function &getParentDocType()
    {
        return $this->parentdoctype;
    }

    public function getAttachementArray()
    {
        if (! isset($this->parentdocnumber) or ! isset($this->parentdoctype))
            return;
        return SqlSuiviBis::rqAttachementAllType($this->getParentDocNumber(), $this->getParentDocType())->TrouveTous();
    }
}