当前位置: 首页>>代码示例>>PHP>>正文


PHP Doctrine_Core类代码示例

本文整理汇总了PHP中Doctrine_Core的典型用法代码示例。如果您正苦于以下问题:PHP Doctrine_Core类的具体用法?PHP Doctrine_Core怎么用?PHP Doctrine_Core使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Doctrine_Core类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getByLink

 public static function getByLink($link)
 {
     if ($link == '') {
         return self::findList()->execute();
     }
     return Doctrine_Core::getTable('Aktual')->findOneByLink($link);
 }
开发者ID:jager,项目名称:cms,代码行数:7,代码来源:Aktual.php

示例2: sendNotification

 public static function sendNotification($c, $projects, $send_to, $sf_user)
 {
     foreach ($send_to as $type => $users) {
         switch ($type) {
             case 'status':
                 $subject = t::__('Project Status Updated');
                 break;
             default:
                 $subject = t::__('New Project');
                 break;
         }
         $to = array();
         foreach ($users as $v) {
             if ($u = Doctrine_Core::getTable('Users')->find($v)) {
                 $to[$u->getEmail()] = $u->getName();
             }
         }
         $user = $sf_user->getAttribute('user');
         $from[$user->getEmail()] = $user->getName();
         $to[$projects->getUsers()->getEmail()] = $projects->getUsers()->getName();
         $to[$user->getEmail()] = $user->getName();
         if (sfConfig::get('app_send_email_to_owner') == 'off') {
             unset($to[$user->getEmail()]);
         }
         $subject .= ': ' . $projects->getName() . ($projects->getProjectsStatusId() > 0 ? ' [' . $projects->getProjectsStatus()->getName() . ']' : '');
         $body = $c->getComponent('projects', 'emailBody', array('projects' => $projects));
         Users::sendEmail($from, $to, $subject, $body, $sf_user);
     }
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:29,代码来源:Projects.class.php

示例3: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($scss_troop_enrollment = Doctrine_Core::getTable('ScssTroopEnrollment')->find(array($request->getParameter('id'))), sprintf('Object scss_troop_enrollment does not exist (%s).', $request->getParameter('id')));
     $scss_troop_enrollment->delete();
     $this->redirect('troopEnrollment/index');
 }
开发者ID:ner0tic,项目名称:scss,代码行数:7,代码来源:actions.class.php

示例4: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($vehiculo = Doctrine_Core::getTable('vehiculo')->find(array($request->getParameter('id'))), sprintf('Object vehiculo does not exist (%s).', $request->getParameter('id')));
     $vehiculo->delete();
     $this->redirect('vehiculo/index');
 }
开发者ID:edulima1989,项目名称:Sistema-Radiotaxi,代码行数:7,代码来源:actions.class.php

示例5: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($activities = Doctrine_Core::getTable('Activities')->find(array($request->getParameter('activity_id'))), sprintf('Object activities does not exist (%s).', $request->getParameter('activity_id')));
     $activities->delete();
     $this->redirect('activities/index');
 }
开发者ID:rohitbatra1987,项目名称:ruckus_dev,代码行数:7,代码来源:actions.class.php

示例6: save

 public function save(Doctrine_Connection $conn = null)
 {
     try {
         $this->setIsTosync(1);
         parent::save($conn);
         if ($this->getGainId() != null) {
             $send_email_visiteur_template_id = $this->getGain()->getSendEmailVisiteurTemplateId();
             $send_email_admin_template_id = $this->getGain()->getSendEmailAdminTemplateId();
             if ($send_email_visiteur_template_id || $send_email_admin_template_id) {
                 $visiteur = Doctrine_Core::getTable('Visiteur')->findOneBy('guid', $this->getVisiteurId());
                 $gain = $this->getGain();
                 $univers_status = $this->getUniversStatus();
                 $visiteur_email = $visiteur->getEmail();
                 $admin_email = sfConfig::get('app_gain_admin_email', null);
                 $array_replace = array('$visiteur_pseudo' => $visiteur->getPseudoSon(), '$visiteur_nom' => $visiteur->getNom(), '$visiteur_prenom' => $visiteur->getPrenom(), '$visiteur_adresse1' => $visiteur->getAdresse(), '$visiteur_adresse2' => $visiteur->getAdresse2(), '$visiteur_cp' => $visiteur->getCodePostal(), '$visiteur_ville' => $visiteur->getVille(), '$visiteur_num_mobile' => $visiteur->getNumMobile(), '$visiteur_email' => $visiteur->getEmail(), '$host_image_src' => sfConfig::get('app_host_image_src'), '$gain_libelle' => $gain->getLibelle(), '$gain_image' => $gain->getImage(), '$gain_description' => $gain->getDescription(), '$gain_start_at' => $gain->getStartAt(), '$gain_end_at' => $gain->getEndAt(), '$univers_status_level' => $univers_status->getLevel(), '$univers_status_level_name' => $univers_status->getLevelName(), '$univers_status_description' => $univers_status->getDescription(), '$univers_status_libelle' => $univers_status->getLibelle());
             }
             // envoi d'un email au visiteur
             if ($send_email_visiteur_template_id && $visiteur_email) {
                 $template = Doctrine_Query::create()->from('TemplateMail t')->where('t.guid = ?', $send_email_visiteur_template_id)->fetchOne();
                 if ($template !== false) {
                     $template->sendEmail($visiteur_email, $array_replace);
                 }
             }
             // envoi d'un email a l'admin
             if ($send_email_admin_template_id && $admin_email) {
                 $template = Doctrine_Query::create()->from('TemplateMail t')->where('t.guid = ?', $send_email_admin_template_id)->fetchOne();
                 if ($template !== false) {
                     $template->sendEmail($admin_email, $array_replace);
                 }
             }
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:pmoutet,项目名称:navinum,代码行数:35,代码来源:VisiteurUniversStatusGain.class.php

示例7: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($jobeet_job = Doctrine_Core::getTable('JobeetJob')->find(array($request->getParameter('id'))), sprintf('Object jobeet_job does not exist (%s).', $request->getParameter('id')));
     $jobeet_job->delete();
     $this->redirect('job/index');
 }
开发者ID:reechalee,项目名称:symfony1.4,代码行数:7,代码来源:actions.class.php

示例8: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($phases_status = Doctrine_Core::getTable('PhasesStatus')->find(array($request->getParameter('id'))), sprintf('Object phases_status does not exist (%s).', $request->getParameter('id')));
     $phases_status->delete();
     $this->redirect('phasesStatus/index');
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:7,代码来源:actions.class.php

示例9: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($theme_scorecard = Doctrine_Core::getTable('Theme_Scorecard')->find(array($request->getParameter('id'))), sprintf('Object theme_scorecard does not exist (%s).', $request->getParameter('id')));
     $theme_scorecard->delete();
     $this->redirect('themescorecard/index');
 }
开发者ID:hunde,项目名称:bsc,代码行数:7,代码来源:actions.class.php

示例10: executeChangestatus

 public function executeChangestatus()
 {
     $object = Doctrine_Core::getTable('mycvExperiences')->findOneById($this->getRequestParameter('id'));
     $object->changeStatus();
     $this->getUser()->setFlash('notice', 'Status was modified successfully');
     $this->redirect('@nd_adminExperiences');
 }
开发者ID:ndachez,项目名称:dachez,代码行数:7,代码来源:actions.class.php

示例11: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($account_invoice = Doctrine_Core::getTable('AccountInvoice')->find(array($request->getParameter('id'))), sprintf('Object account_invoice does not exist (%s).', $request->getParameter('id')));
     $account_invoice->delete();
     $this->redirect('invoice/index');
 }
开发者ID:nidhhoggr,项目名称:supra,代码行数:7,代码来源:actions.class.php

示例12: getChoices

 public function getChoices()
 {
     $choices = array();
     if (false !== $this->getOption('add_empty')) {
         $choices[''] = true === $this->getOption('add_empty') ? '' : $this->getOption('add_empty');
     }
     if (null === $this->getOption('table_method')) {
         $query = null === $this->getOption('query') ? Doctrine_Core::getTable($this->getOption('model'))->createQuery() : $this->getOption('query');
         $query->addOrderBy('root_id asc')->addOrderBy('lft asc');
         $objects = $query->execute();
     } else {
         $tableMethod = $this->getOption('table_method');
         $results = Doctrine_Core::getTable($this->getOption('model'))->{$tableMethod}();
         if ($results instanceof Doctrine_Query) {
             $objects = $results->execute();
         } else {
             if ($results instanceof Doctrine_Collection) {
                 $objects = $results;
             } else {
                 if ($results instanceof Doctrine_Record) {
                     $objects = new Doctrine_Collection($this->getOption('model'));
                     $objects[] = $results;
                 } else {
                     $objects = array();
                 }
             }
         }
     }
     $method = $this->getOption('method');
     $keyMethod = $this->getOption('key_method');
     foreach ($objects as $object) {
         $choices[$object->{$keyMethod}()] = str_repeat(' ', $object['level'] * 4) . $object->{$method}();
     }
     return $choices;
 }
开发者ID:228vit,项目名称:sftree,代码行数:35,代码来源:sfWidgetFormDoctrineChoiceNestedSet.class.php

示例13: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($scss_course = Doctrine_Core::getTable('ScssCourse')->find(array($request->getParameter('id'))), sprintf('Object scss_course does not exist (%s).', $request->getParameter('id')));
     $scss_course->delete();
     $this->redirect('course/index');
 }
开发者ID:ner0tic,项目名称:scss,代码行数:7,代码来源:actions.class.php

示例14: testColumnAggregation

 public function testColumnAggregation()
 {
     $animal = Doctrine_Core::getTable('mkNode')->findOneById(1);
     $this->assertTrue($animal instanceof mkAnimal);
     $plant = Doctrine_Core::getTable('mkOrganism')->findOneById(2);
     $this->assertTrue($plant instanceof mkPlant);
 }
开发者ID:dennybrandes,项目名称:doctrine1,代码行数:7,代码来源:2015TestCase.php

示例15: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($user = Doctrine_Core::getTable('User')->find(array($request->getParameter('user_id'))), sprintf('Object user does not exist (%s).', $request->getParameter('user_id')));
     $user->delete();
     $this->redirect('my_ruckus/index');
 }
开发者ID:rohitbatra1987,项目名称:ruckus_dev,代码行数:7,代码来源:actions.class.php


注:本文中的Doctrine_Core类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。