예제 #1
0
 /**
  * @url DELETE /:prj_uid/input-document/:inp_doc_uid
  *
  * @param string $inp_doc_uid {@min 32}{@max 32}
  * @param string $prj_uid     {@min 32}{@max 32}
  */
 public function doDeleteInputDocument($inp_doc_uid, $prj_uid)
 {
     try {
         $inputDocument = new \ProcessMaker\BusinessModel\InputDocument();
         $inputDocument->setFormatFieldNameInUppercase(false);
         $inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid"));
         $inputDocument->delete($inp_doc_uid);
     } catch (\Exception $e) {
         throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
     }
 }
예제 #2
0
    /**
     * Get all InputDocuments of a Process
     *
     * @param string $processUid Unique id of Process
     *
     * return array Return an array with all InputDocuments of a Process
     */
    public function getInputDocuments($processUid)
    {
        try {
            $arrayInputDocument = array();

            //Verify data
            $this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);

            //Get data
            $inputDocument = new \ProcessMaker\BusinessModel\InputDocument();
            $inputDocument->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
            $inputDocument->setArrayFieldNameForException($this->arrayFieldNameForException);

            $criteria = $inputDocument->getInputDocumentCriteria();

            $criteria->add(\InputDocumentPeer::PRO_UID, $processUid, \Criteria::EQUAL);
            $criteria->addAscendingOrderByColumn("INP_DOC_TITLE");

            $rsCriteria = \InputDocumentPeer::doSelectRS($criteria);
            $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);

            while ($rsCriteria->next()) {
                $row = $rsCriteria->getRow();

                $arrayInputDocument[] = $inputDocument->getInputDocumentDataFromRecord($row);
            }

            //Return
            return $arrayInputDocument;
        } catch (\Exception $e) {
            throw $e;
        }
    }