/** * Grab PDF of Manifest or Label Content put to file and return path to file * @param $type (string) - 'label' | 'manifest' who need to get * @param $parameters (array) - Some parameters id_order is request * @return mix */ public function getPdfFile($type, $parameters = array(), $action = 'join') { if (!is_string($type)) { self::log('getPdfFile -> $type variable type is not correct, available (string) given: ' . gettype($type)); return false; } switch ($type) { case 'label': return DpdLabelRender::getLabel(array('id_orders' => $parameters), $action); case 'manifest': return DpdManifestRender::getManifest(array('id_orders' => $parameters)); default: self::log('getPdfFile -> Type not found I got: ' . $type); return false; } }