Example #1
0
 public function executeResumepdf()
 {
     $c = new Criteria();
     $c->add(ResumePeer::USER_ID, $this->getUser()->getAttribute('userid'));
     $resume = ResumePeer::doSelectOne($c);
     // pdf object
     $pdf = new sfTCPDF();
     // settings
     $pdf->SetFont("FreeSerif", "", 12);
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     //$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
     //$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // init pdf doc
     //$pdf->AliasNbPages();
     $pdf->AddPage();
     //$pdf->Cell(80, 10, $resume->getContent());
     $pdf->writeHTMLCell(200, 10, PDF_MARGIN_LEFT, PDF_MARGIN_TOP, $resume->getContent());
     // output
     $pdf->Output();
     return sfView::NONE;
 }
Example #2
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = ResumePeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setUserId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setContent($arr[$keys[2]]);
     }
 }
Example #3
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(ResumePeer::ID, $pks, Criteria::IN);
         $objs = ResumePeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #4
0
 public function countResumes($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseResumePeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(ResumePeer::USER_ID, $this->getId());
     return ResumePeer::doCount($criteria, $distinct, $con);
 }