• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Propel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: executeMenu

 public function executeMenu()
 {
     $this->setLayout(false);
     $con = Propel::getConnection();
     $year = date("Y");
     $years = array();
     $sql = "SELECT DISTINCT MONTH(start_date) AS month FROM m_news WHERE start_date LIKE '" . $year . "%'";
     $stmt = $con->createStatement();
     $rs = $stmt->executeQuery($sql);
     while ($rs->next()) {
         $months[] = $rs->get("month");
     }
     $con = Propel::getConnection();
     $year = date("Y");
     $sql = "SELECT DISTINCT YEAR(start_date) AS year FROM m_news";
     $stmt = $con->createStatement();
     $rs = $stmt->executeQuery($sql);
     while ($rs->next()) {
         $years[$rs->get("year")] = $rs->get("year");
     }
     unset($years[$year]);
     if (!empty($years)) {
         $this->pastYears = $years;
     }
     $this->monthsArr = array(1 => "january", 2 => "february", 3 => "march", 4 => "april", 5 => "may", 6 => "june", 7 => "july", 8 => "august", 9 => "september", 10 => "october", 11 => "november", 12 => "december");
     //UtilsHelper::Date()
     $this->months = $months;
     $this->getRequestParameter("month") ? $this->currentMonth = $this->getRequestParameter("month") : ($this->currentMonth = date("n"));
     $this->currentYear = $year;
 }
开发者ID:kotow,项目名称:work,代码行数:30,代码来源:actions.class.php


示例2: initialize

 /**
  * @see sfPluginConfiguration
  */
 public function initialize()
 {
     sfConfig::set('sf_orm', 'propel');
     if (!sfConfig::get('sf_admin_module_web_dir')) {
         sfConfig::set('sf_admin_module_web_dir', '/sfPropelPlugin');
     }
     sfToolkit::addIncludePath(array(sfConfig::get('sf_root_dir'), sfConfig::get('sf_propel_runtime_path', realpath(dirname(__FILE__) . '/../lib/vendor'))));
     require_once 'propel/Propel.php';
     if (!Propel::isInit()) {
         if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) {
             Propel::setLogger(new sfPropelLogger($this->dispatcher));
         }
         $propelConfiguration = new PropelConfiguration();
         Propel::setConfiguration($propelConfiguration);
         $this->dispatcher->notify(new sfEvent($propelConfiguration, 'propel.configure'));
         Propel::initialize();
     }
     $this->dispatcher->connect('user.change_culture', array('sfPropel', 'listenToChangeCultureEvent'));
     if (sfConfig::get('sf_web_debug')) {
         $this->dispatcher->connect('debug.web.load_panels', array('sfWebDebugPanelPropel', 'listenToAddPanelEvent'));
     }
     if (sfConfig::get('sf_test')) {
         $this->dispatcher->connect('context.load_factories', array($this, 'clearAllInstancePools'));
     }
 }
开发者ID:xfifix,项目名称:symfony-1.4,代码行数:28,代码来源:sfPropelPluginConfiguration.class.php


示例3: getPopularTags

 public static function getPopularTags($max = 30)
 {
     $connection = Propel::getConnection();
     $query = 'SELECT %s as query, COUNT(*) as count
           FROM %s
           INNER JOIN %s ON %s = %s
           INNER JOIN %s ON %s = %s
           WHERE %s = %s
           GROUP BY query
           ORDER BY count DESC';
     $query = sprintf($query, QueryPeer::QUERY, QueryPeer::TABLE_NAME, ReportQueryPeer::TABLE_NAME, QueryPeer::ID, ReportQueryPeer::QUERY_ID, ReportPeer::TABLE_NAME, ReportQueryPeer::REPORT_ID, ReportPeer::ID, ReportPeer::PUBLIC_RECORD, true);
     $statement = $connection->prepareStatement($query);
     $statement->setLimit($max);
     $resultset = $statement->executeQuery();
     $tags = array();
     $max_count = 0;
     while ($resultset->next()) {
         if (!$max_count) {
             $max_count = $resultset->getInt('count');
         }
         $queries[] = array('query' => $resultset->getString('query'), 'rank' => floor($resultset->getInt('count') / $max_count * 9 + 1), 'count' => $resultset->getInt('count'));
     }
     ksort($queries);
     return $queries;
 }
开发者ID:hoydaa,项目名称:googlevolume.com,代码行数:25,代码来源:QueryPeer.php


示例4: doBuild

 /**
  * The doBuild() method builds the DatabaseMap
  *
  * @return     void
  * @throws     PropelException
  */
 public function doBuild()
 {
     $this->dbMap = Propel::getDatabaseMap('workflow');
     $tMap = $this->dbMap->addTable('APP_DELEGATION');
     $tMap->setPhpName('AppDelegation');
     $tMap->setUseIdGenerator(false);
     $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
     $tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
     $tMap->addColumn('DEL_PREVIOUS', 'DelPrevious', 'int', CreoleTypes::INTEGER, true, null);
     $tMap->addColumn('DEL_LAST_INDEX', 'DelLastIndex', 'int', CreoleTypes::INTEGER, true, null);
     $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
     $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
     $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
     $tMap->addColumn('DEL_TYPE', 'DelType', 'string', CreoleTypes::VARCHAR, true, 32);
     $tMap->addColumn('DEL_THREAD', 'DelThread', 'int', CreoleTypes::INTEGER, true, null);
     $tMap->addColumn('DEL_THREAD_STATUS', 'DelThreadStatus', 'string', CreoleTypes::VARCHAR, true, 32);
     $tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
     $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
     $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null);
     $tMap->addColumn('DEL_TASK_DUE_DATE', 'DelTaskDueDate', 'int', CreoleTypes::TIMESTAMP, false, null);
     $tMap->addColumn('DEL_FINISH_DATE', 'DelFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
     $tMap->addColumn('DEL_DURATION', 'DelDuration', 'double', CreoleTypes::DOUBLE, false, null);
     $tMap->addColumn('DEL_QUEUE_DURATION', 'DelQueueDuration', 'double', CreoleTypes::DOUBLE, false, null);
     $tMap->addColumn('DEL_DELAY_DURATION', 'DelDelayDuration', 'double', CreoleTypes::DOUBLE, false, null);
     $tMap->addColumn('DEL_STARTED', 'DelStarted', 'int', CreoleTypes::TINYINT, false, null);
     $tMap->addColumn('DEL_FINISHED', 'DelFinished', 'int', CreoleTypes::TINYINT, false, null);
     $tMap->addColumn('DEL_DELAYED', 'DelDelayed', 'int', CreoleTypes::TINYINT, false, null);
     $tMap->addColumn('DEL_DATA', 'DelData', 'string', CreoleTypes::LONGVARCHAR, true, null);
     $tMap->addColumn('APP_OVERDUE_PERCENTAGE', 'AppOverduePercentage', 'double', CreoleTypes::DOUBLE, true, null);
     $tMap->addValidator('DEL_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|PARALLEL', 'Please select a valid status.');
     $tMap->addValidator('DEL_PRIORITY', 'validValues', 'propel.validator.ValidValuesValidator', '1|2|3|4|5', 'Please select a valid Priority.');
     $tMap->addValidator('DEL_THREAD_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'CLOSED|OPEN|PAUSED', 'Please select a valid status.');
 }
开发者ID:bqevin,项目名称:processmaker,代码行数:39,代码来源:AppDelegationMapBuilder.php


示例5: doBuild

 /**
  * The doBuild() method builds the DatabaseMap
  *
  * @return     void
  * @throws     PropelException
  */
 public function doBuild()
 {
     $this->dbMap = Propel::getDatabaseMap(AfaOrgPeer::DATABASE_NAME);
     $tMap = $this->dbMap->addTable(AfaOrgPeer::TABLE_NAME);
     $tMap->setPhpName('AfaOrg');
     $tMap->setClassname('AfaOrg');
     $tMap->setUseIdGenerator(true);
     $tMap->addPrimaryKey('ID', 'Id', 'INTEGER', true, 11);
     $tMap->addColumn('NAME', 'Name', 'VARCHAR', true, 60);
     $tMap->addColumn('ORG_PHONE', 'OrgPhone', 'VARCHAR', false, 16);
     $tMap->addColumn('HOME_PAGE_URL', 'HomePageUrl', 'VARCHAR', false, 80);
     $tMap->addColumn('ORG_FAX', 'OrgFax', 'VARCHAR', false, 16);
     $tMap->addColumn('REF_CONTACT_NAME', 'RefContactName', 'VARCHAR', false, 25);
     $tMap->addColumn('REF_CONTACT_EMAIL', 'RefContactEmail', 'VARCHAR', false, 80);
     $tMap->addColumn('VPO_SOAP_SERVER_URL', 'VpoSoapServerUrl', 'VARCHAR', false, 125);
     $tMap->addColumn('VPO_REQUEST_POST_EMAIL', 'VpoRequestPostEmail', 'VARCHAR', false, 125);
     $tMap->addColumn('VPO_USER_ID', 'VpoUserId', 'VARCHAR', false, 25);
     $tMap->addColumn('VPO_USER_PASSWORD', 'VpoUserPassword', 'VARCHAR', false, 25);
     $tMap->addColumn('VPO_ORG_ID', 'VpoOrgId', 'VARCHAR', false, 5);
     $tMap->addColumn('AFIDS_REQUESTER_USER_NAME', 'AfidsRequesterUserName', 'VARCHAR', false, 25);
     $tMap->addColumn('AFIDS_REQUESTER_PASSWORD', 'AfidsRequesterPassword', 'VARCHAR', false, 25);
     $tMap->addColumn('AFIDS_SOAP_SERVER_URL', 'AfidsSoapServerUrl', 'VARCHAR', false, 125);
     $tMap->addColumn('AFIDS_REQUEST_POST_EMAIL', 'AfidsRequestPostEmail', 'VARCHAR', false, 125);
     $tMap->addColumn('PHONE_NUMBER1', 'PhoneNumber1', 'VARCHAR', false, 16);
     $tMap->addColumn('PHONE_NUMBER2', 'PhoneNumber2', 'VARCHAR', false, 16);
 }
开发者ID:yasirgit,项目名称:afids,代码行数:32,代码来源:AfaOrgMapBuilder.php


示例6: executeSidebar

 public function executeSidebar(sfWebRequest $request)
 {
     $route = sfContext::getInstance()->getRouting()->getCurrentRouteName();
     $this->route = $route;
     $id = $request->getParameter('catalogId');
     $stm = Propel::getConnection()->prepare('
         SELECT title,id FROM category WHERE parent_id=4
     ');
     $stm->execute();
     $menu = $stm->fetchAll(PDO::FETCH_OBJ);
     $this->menu = $menu;
     $stm = Propel::getConnection()->prepare('
         SELECT
             title,id
         FROM
             category_has_product
         INNER JOIN product ON product.id = category_has_product.product_id
         WHERE
             category_has_product.category_id = :id
     ');
     $stm->bindParam(':id', $id);
     $stm->execute();
     $product = $stm->fetchAll(PDO::FETCH_OBJ);
     $this->product = $product;
 }
开发者ID:alexspark21,项目名称:symfony_bisM,代码行数:25,代码来源:components.class.php


示例7: testInvalidCharset

 public function testInvalidCharset()
 {
     $this->markTestSkipped();
     $db = Propel::getDB(BookPeer::DATABASE_NAME);
     if ($db instanceof DBSQLite) {
         $this->markTestSkipped();
     }
     $a = new Author();
     $a->setFirstName("Б.");
     $a->setLastName("АКУНИН");
     $a->save();
     $authorNameWindows1251 = iconv("utf-8", "windows-1251", $a->getLastName());
     $a->setLastName($authorNameWindows1251);
     // Different databases seem to handle invalid data differently (no surprise, I guess...)
     if ($db instanceof DBPostgres) {
         try {
             $a->save();
             $this->fail("Expected an exception when saving non-UTF8 data to database.");
         } catch (Exception $x) {
             print $x;
         }
     } else {
         // No exception is thrown by MySQL ... (others need to be tested still)
         $a->save();
         $a->reload();
         $this->assertEquals("", $a->getLastName(), "Expected last_name to be empty (after inserting invalid charset data)");
     }
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:28,代码来源:CharacterEncodingTest.php


示例8: setDefaultRelatedElements

 /**
  * Inserts the menu links related to the inserted content,
  * into the w3sMenuElements table
  *   
  * @return bool
  * 
  */
 protected function setDefaultRelatedElements()
 {
     $bRollBack = false;
     $con = Propel::getConnection();
     $con = w3sPropelWorkaround::beginTransaction($con);
     for ($i = 1; $i < 4; $i++) {
         $newMenu = new W3sMenuElement();
         $contentValues = array("ContentId" => $this->content->getId(), "PageId" => 0, "Link" => w3sCommonFunctions::toI18n('This is a link'), "ExternalLink" => '', "Image" => '', "RolloverImage" => '', "Position" => $i);
         $newMenu->fromArray($contentValues);
         $result = $newMenu->save();
         if ($newMenu->isModified() && $result == 0) {
             $bRollBack = true;
             break;
         }
     }
     if (!$bRollBack) {
         // Everything was fine so W3StudioCMS commits to database
         $con->commit();
         $result = true;
     } else {
         // Something was wrong so W3StudioCMS aborts the operation and restores to previous status
         w3sPropelWorkaround::rollBack($con);
         $result = false;
     }
 }
开发者ID:jmp0207,项目名称:w3studiocms,代码行数:32,代码来源:w3sContentManagerMenu.class.php


示例9: doBuild

 /**
  * The doBuild() method builds the DatabaseMap
  *
  * @return     void
  * @throws     PropelException
  */
 public function doBuild()
 {
     $this->dbMap = Propel::getDatabaseMap(MissionReportPeer::DATABASE_NAME);
     $tMap = $this->dbMap->addTable(MissionReportPeer::TABLE_NAME);
     $tMap->setPhpName('MissionReport');
     $tMap->setClassname('MissionReport');
     $tMap->setUseIdGenerator(true);
     $tMap->addPrimaryKey('ID', 'Id', 'INTEGER', true, 4);
     $tMap->addColumn('REPORT_DATE', 'ReportDate', 'TIMESTAMP', false, null);
     $tMap->addColumn('MISSION_DATE', 'MissionDate', 'TIMESTAMP', false, null);
     $tMap->addColumn('COPILOT_NAME', 'CopilotName', 'VARCHAR', false, 50);
     $tMap->addColumn('MEMBER_COPILOT', 'MemberCopilot', 'TINYINT', false, 1);
     $tMap->addForeignKey('AIRCRAFT_ID', 'AircraftId', 'INTEGER', 'aircraft', 'ID', false, 4);
     $tMap->addColumn('N_NUMBER', 'NNumber', 'VARCHAR', false, 8);
     $tMap->addColumn('MAKEMODEL', 'Makemodel', 'VARCHAR', false, 60);
     $tMap->addColumn('HOBBS_TIME', 'HobbsTime', 'TIME', false, null);
     $tMap->addColumn('PASSENGER_NAMES', 'PassengerNames', 'VARCHAR', false, 255);
     $tMap->addColumn('MISSION_COMMENTS', 'MissionComments', 'LONGVARCHAR', false, null);
     $tMap->addColumn('EXPENSE_REPORT', 'ExpenseReport', 'LONGVARCHAR', false, null);
     $tMap->addColumn('APPROVED', 'Approved', 'TINYINT', false, 1);
     $tMap->addColumn('PICKUP_AIRPORT_IDENT', 'PickupAirportIdent', 'VARCHAR', false, 25);
     $tMap->addColumn('DROPOFF_AIRPORT_IDENT', 'DropoffAirportIdent', 'VARCHAR', false, 25);
     $tMap->addColumn('ROUTING', 'Routing', 'VARCHAR', false, 40);
     $tMap->addColumn('COMMERCIAL_TICKET_COST', 'CommercialTicketCost', 'INTEGER', false, 8);
     $tMap->addColumn('AIRLINE_REF_NUMBER', 'AirlineRefNumber', 'VARCHAR', false, 40);
     $tMap->addColumn('AIRLINE_OWRT', 'AirlineOwrt', 'VARCHAR', false, 2);
     $tMap->addColumn('MILEAGE', 'Mileage', 'INTEGER', false, 4);
     $tMap->addColumn('PHOTO1', 'Photo1', 'VARCHAR', false, 255);
     $tMap->addColumn('PHOTO2', 'Photo2', 'VARCHAR', false, 255);
     $tMap->addColumn('PHOTO3', 'Photo3', 'VARCHAR', false, 255);
     $tMap->addColumn('PHOTO4', 'Photo4', 'VARCHAR', false, 255);
     $tMap->addColumn('PHOTO5', 'Photo5', 'VARCHAR', false, 255);
 }
开发者ID:yasirgit,项目名称:afids,代码行数:39,代码来源:MissionReportMapBuilder.php


示例10: testExplainPlanFromString

 public function testExplainPlanFromString()
 {
     BookstoreDataPopulator::depopulate($this->con);
     BookstoreDataPopulator::populate($this->con);
     $db = Propel::getDb(BookPeer::DATABASE_NAME);
     $query = 'SELECT book.TITLE AS Title FROM book INNER JOIN author ON (book.AUTHOR_ID=author.ID) WHERE author.FIRST_NAME = \'Neal\'';
     $stmt = $db->doExplainPlan($this->con, $query);
     $explain = $stmt->fetchAll(PDO::FETCH_ASSOC);
     if ($db instanceof DBMySQL) {
         $this->assertEquals(sizeof($explain), 2, 'Explain plan return two lines');
         // explain can change sometime, test can't be strict
         $this->assertArrayHasKey('select_type', $explain[0], 'Line 1, select_type key exist');
         $this->assertArrayHasKey('table', $explain[0], 'Line 1, table key exist');
         $this->assertArrayHasKey('type', $explain[0], 'Line 1, type key exist');
         $this->assertArrayHasKey('possible_keys', $explain[0], 'Line 1, possible_keys key exist');
         $this->assertArrayHasKey('select_type', $explain[1], 'Line 2, select_type key exist');
         $this->assertArrayHasKey('table', $explain[1], 'Line 2, table key exist');
         $this->assertArrayHasKey('type', $explain[1], 'Line 2, type key exist');
         $this->assertArrayHasKey('possible_keys', $explain[1], 'Line 2, possible_keys key exist');
     } elseif ($db instanceof DBOracle) {
         $this->assertTrue(sizeof($explain) > 2, 'Explain plan return more than 2 lines');
     } else {
         $this->markTestSkipped('Cannot test explain plan on adapter ' . get_class($db));
     }
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:25,代码来源:ExplainPlanTest.php


示例11: copyRelatedElements

 /**
  * Copies the menu links for the sourceContent to the targetContent
  *  
  * @parameter  int The id of the source content
  * @parameter  int The id of the target content
  * 
  * @return     bool false - The save operation has failed
  *                  true  - The save operation has correctly done 
  */
 public static function copyRelatedElements($sourceContent, $targetContent)
 {
     $bRollBack = false;
     $con = Propel::getConnection();
     $con = w3sPropelWorkaround::beginTransaction($con);
     // Deletes all the target menus
     $targetMenus = W3sMenuElementPeer::getContentMenu($targetContent);
     foreach ($targetMenus as $targetMenu) {
         $targetMenu->delete();
     }
     // Retrieves the menu rows related to source content
     $sourceMenus = DbFinder::from('W3sMenuElement')->where('contentId', $sourceContent)->orderBy('position')->find();
     foreach ($sourceMenus as $sourceMenu) {
         $oTargetMenu = new W3sMenuElement();
         $contentValues = array("ContentId" => $targetContent, "PageId" => $sourceMenu->getPageId(), "Link" => $sourceMenu->getLink(), "ExternalLink" => $sourceMenu->getExternalLink(), "Image" => $sourceMenu->getImage(), "RolloverImage" => $sourceMenu->getRolloverImage(), "Position" => $sourceMenu->getPosition());
         $oTargetMenu->fromArray($contentValues);
         // Saves
         $result = $oTargetMenu->save();
         if ($oTargetMenu->isModified() && $result == 0) {
             $bRollBack = true;
             break;
         }
     }
     if (!$bRollBack) {
         // Everything was fine so W3StudioCMS commits to database
         $con->commit();
         $result = true;
     } else {
         // Something was wrong so W3StudioCMS aborts the operation and restores to previous status
         w3sPropelWorkaround::rollBack($con);
         $result = false;
     }
     return $result;
 }
开发者ID:jmp0207,项目名称:w3studiocms,代码行数:43,代码来源:w3sContentManagerMenuPeer.class.php


示例12: doBuild

 public function doBuild()
 {
     $this->dbMap = Propel::getDatabaseMap('propel');
     $tMap = $this->dbMap->addTable('student');
     $tMap->setPhpName('Student');
     $tMap->setUseIdGenerator(true);
     $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
     $tMap->addColumn('CODE', 'Code', 'string', CreoleTypes::VARCHAR, false, 64);
     $tMap->addColumn('CODE2', 'Code2', 'string', CreoleTypes::VARCHAR, false, 64);
     $tMap->addColumn('CODE3', 'Code3', 'string', CreoleTypes::VARCHAR, false, 64);
     $tMap->addColumn('NAME', 'Name', 'string', CreoleTypes::VARCHAR, false, 255);
     $tMap->addForeignKey('CURRICULUM_ID', 'CurriculumId', 'int', CreoleTypes::INTEGER, 'curriculum', 'ID', false, null);
     $tMap->addForeignKey('ACADEMIC_CALENDAR_ID', 'AcademicCalendarId', 'int', CreoleTypes::INTEGER, 'academic_calendar', 'ID', false, null);
     $tMap->addForeignKey('CLASS_GROUP_ID', 'ClassGroupId', 'int', CreoleTypes::INTEGER, 'class_group', 'ID', false, null);
     $tMap->addForeignKey('TEST_APPLICANT_ID', 'TestApplicantId', 'int', CreoleTypes::INTEGER, 'test_applicant', 'ID', false, null);
     $tMap->addForeignKey('STUDENT_DETAIL_ID', 'StudentDetailId', 'int', CreoleTypes::INTEGER, 'student_detail', 'ID', false, null);
     $tMap->addForeignKey('MEMBER_ID', 'MemberId', 'int', CreoleTypes::INTEGER, 'member', 'ID', false, null);
     $tMap->addColumn('STATUS', 'Status', 'string', CreoleTypes::CHAR, false, null);
     $tMap->addColumn('GRADUATION_DATE', 'GraduationDate', 'int', CreoleTypes::DATE, false, null);
     $tMap->addColumn('PASSWORD', 'Password', 'string', CreoleTypes::VARCHAR, true, 40);
     $tMap->addColumn('CLASS_NAME', 'ClassName', 'string', CreoleTypes::VARCHAR, false, 2);
     $tMap->addColumn('YEAR', 'Year', 'string', CreoleTypes::VARCHAR, false, 4);
     $tMap->addColumn('DATE_IN', 'DateIn', 'int', CreoleTypes::DATE, false, null);
     $tMap->addColumn('NIK', 'Nik', 'string', CreoleTypes::VARCHAR, false, 64);
 }
开发者ID:taryono,项目名称:school,代码行数:25,代码来源:StudentMapBuilder.php


示例13: doBuild

 /**
  * The doBuild() method builds the DatabaseMap
  *
  * @return     void
  * @throws     PropelException
  */
 public function doBuild()
 {
     $this->dbMap = Propel::getDatabaseMap(UserProfilePeer::DATABASE_NAME);
     $tMap = $this->dbMap->addTable(UserProfilePeer::TABLE_NAME);
     $tMap->setPhpName('UserProfile');
     $tMap->setClassname('UserProfile');
     $tMap->setUseIdGenerator(true);
     $tMap->addPrimaryKey('ID', 'Id', 'INTEGER', true, null);
     $tMap->addForeignKey('USER_ID', 'UserId', 'INTEGER', 'sf_guard_user', 'ID', true, null);
     $tMap->addColumn('LANGUAGE', 'Language', 'VARCHAR', false, 5);
     $tMap->addColumn('NOMBRE', 'Nombre', 'VARCHAR', false, 255);
     $tMap->addColumn('APELLIDO', 'Apellido', 'VARCHAR', false, 255);
     $tMap->addColumn('FDN', 'Fdn', 'DATE', false, null);
     $tMap->addForeignKey('NACIONALIDAD', 'Nacionalidad', 'INTEGER', 'geo_pais', 'ID', false, null);
     $tMap->addColumn('DOCUMENTO_TIPO', 'DocumentoTipo', 'TINYINT', false, null);
     $tMap->addColumn('DOCUMENTO_NUMERO', 'DocumentoNumero', 'VARCHAR', false, 15);
     $tMap->addColumn('CUIL', 'Cuil', 'VARCHAR', false, 13);
     $tMap->addColumn('LEGAJO', 'Legajo', 'VARCHAR', false, 5);
     $tMap->addColumn('TELEFONO', 'Telefono', 'VARCHAR', false, 255);
     $tMap->addColumn('MOVIL', 'Movil', 'VARCHAR', false, 255);
     $tMap->addColumn('EMAIL', 'Email', 'VARCHAR', false, 255);
     $tMap->addColumn('DOMICILIO_CALLE', 'DomicilioCalle', 'VARCHAR', false, 50);
     $tMap->addColumn('DOMICILIO_NUMERO', 'DomicilioNumero', 'VARCHAR', false, 5);
     $tMap->addColumn('DOMICILIO_MANZANA', 'DomicilioManzana', 'VARCHAR', false, 5);
     $tMap->addColumn('DOMICILIO_BARRIO', 'DomicilioBarrio', 'VARCHAR', false, 50);
     $tMap->addColumn('DOMICILIO_PISO', 'DomicilioPiso', 'VARCHAR', false, 2);
     $tMap->addColumn('DOMICILIO_DEPTO', 'DomicilioDepto', 'VARCHAR', false, 2);
     $tMap->addForeignKey('LOCALIDAD_ID', 'LocalidadId', 'INTEGER', 'geo_localidad', 'ID', false, null);
     $tMap->addForeignKey('PROVINCIA_ID', 'ProvinciaId', 'INTEGER', 'geo_provincia', 'ID', false, null);
     $tMap->addColumn('COMENTARIO', 'Comentario', 'LONGVARCHAR', false, null);
 }
开发者ID:retrofox,项目名称:PCC,代码行数:37,代码来源:UserProfileMapBuilder.php


示例14: abortDbBatchJob

 public static function abortDbBatchJob(BatchJob $dbBatchJob, $force = false)
 {
     // No need to abort finished job
     if (in_array($dbBatchJob->getStatus(), BatchJobPeer::getClosedStatusList())) {
         if ($force) {
             $dbBatchJob->setExecutionStatus(BatchJobExecutionStatus::ABORTED);
             $dbBatchJob->save();
         }
         return $dbBatchJob;
     }
     $lockObject = $dbBatchJob->getBatchJobLock();
     if (is_null($lockObject)) {
         KalturaLog::err("Batch job [" . $dbBatchJob->getId() . "] doesn't have a lock object and can't be deleted. Status (" . $dbBatchJob->getStatus() . ")");
         return $dbBatchJob;
     }
     // Update status
     $con = Propel::getConnection();
     $update = new Criteria();
     $update->add(BatchJobLockPeer::STATUS, BatchJob::BATCHJOB_STATUS_ABORTED);
     $update->add(BatchJobLockPeer::VERSION, $lockObject->getVersion() + 1);
     $updateCondition = new Criteria();
     $updateCondition->add(BatchJobLockPeer::ID, $lockObject->getId(), Criteria::EQUAL);
     $updateCondition->add(BatchJobLockPeer::VERSION, $lockObject->getVersion(), Criteria::EQUAL);
     $updateCondition->add(BatchJobLockPeer::SCHEDULER_ID, null, Criteria::ISNULL);
     $affectedRows = BasePeer::doUpdate($updateCondition, $update, $con);
     if ($affectedRows) {
         $dbBatchJob->setExecutionStatus(BatchJobExecutionStatus::ABORTED);
         $dbBatchJob = self::updateBatchJob($dbBatchJob, BatchJob::BATCHJOB_STATUS_ABORTED);
     } else {
         $dbBatchJob->setExecutionStatus(BatchJobExecutionStatus::ABORTED);
         $dbBatchJob->save();
     }
     self::abortChildJobs($dbBatchJob);
     return $dbBatchJob;
 }
开发者ID:ace3535,项目名称:server,代码行数:35,代码来源:kJobsManager.php


示例15: doBuild

 /**
  * The doBuild() method builds the DatabaseMap
  *
  * @return     void
  * @throws     PropelException
  */
 public function doBuild()
 {
     $this->dbMap = Propel::getDatabaseMap(ParametroPeer::DATABASE_NAME);
     $tMap = $this->dbMap->addTable(ParametroPeer::TABLE_NAME);
     $tMap->setPhpName('Parametro');
     $tMap->setClassname('Parametro');
     $tMap->setUseIdGenerator(true);
     $tMap->addPrimaryKey('ID_PARAMETRO', 'IdParametro', 'INTEGER', true, null);
     $tMap->addForeignKey('TIPOPARAMETRO', 'Tipoparametro', 'VARCHAR', 'parametro_def', 'TIPOPARAMETRO', true, 100);
     $tMap->addColumn('NOMBRE', 'Nombre', 'VARCHAR', false, 100);
     $tMap->addColumn('ORDEN', 'Orden', 'INTEGER', false, null);
     $tMap->addColumn('NUMERO', 'Numero', 'FLOAT', false, null);
     $tMap->addColumn('NUMERO2', 'Numero2', 'FLOAT', false, null);
     $tMap->addColumn('CADENA', 'Cadena', 'LONGVARCHAR', false, null);
     $tMap->addColumn('CADENA1', 'Cadena1', 'LONGVARCHAR', false, null);
     $tMap->addColumn('OTROOBJETO', 'Otroobjeto', 'INTEGER', false, null);
     $tMap->addColumn('SI_NO', 'SiNo', 'BOOLEAN', false, null);
     $tMap->addColumn('FECHA', 'Fecha', 'TIMESTAMP', false, null);
     $tMap->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null);
     $tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null);
     $tMap->addColumn('FECHABORRADO', 'Fechaborrado', 'TIMESTAMP', false, null);
     $tMap->addColumn('NOMBREFICHERO', 'Nombrefichero', 'VARCHAR', false, 200);
     $tMap->addColumn('TIPO', 'Tipo', 'VARCHAR', false, 100);
     $tMap->addColumn('FICHERO', 'Fichero', 'LONGVARCHAR', false, null);
     $tMap->addColumn('TAMANO', 'Tamano', 'INTEGER', false, null);
 }
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:32,代码来源:ParametroMapBuilder.php


示例16: doBuild

 public function doBuild()
 {
     $this->dbMap = Propel::getDatabaseMap('propel');
     $tMap = $this->dbMap->addTable('v_spp');
     $tMap->setPhpName('VSpp');
     $tMap->setUseIdGenerator(true);
     $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
     $tMap->addForeignKey('STUDENT_ID', 'StudentId', 'int', CreoleTypes::INTEGER, 'student', 'ID', false, null);
     $tMap->addForeignKey('ACADEMIC_COST_ID', 'AcademicCostId', 'int', CreoleTypes::INTEGER, 'academic_cost', 'ID', false, null);
     $tMap->addForeignKey('USER_ID', 'UserId', 'int', CreoleTypes::INTEGER, 'user', 'ID', false, null);
     $tMap->addColumn('AMOUNT', 'Amount', 'double', CreoleTypes::FLOAT, false, null);
     $tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);
     $tMap->addForeignKey('ACADEMIC_PROCESS_ID', 'AcademicProcessId', 'int', CreoleTypes::INTEGER, 'academic_process', 'ID', false, null);
     $tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);
     $tMap->addColumn('PAYER_TYPE', 'PayerType', 'string', CreoleTypes::CHAR, false, 1);
     $tMap->addColumn('RECEIVABLE', 'Receivable', 'double', CreoleTypes::FLOAT, false, null);
     $tMap->addColumn('PAID', 'Paid', 'double', CreoleTypes::FLOAT, false, null);
     $tMap->addColumn('STATUS', 'Status', 'string', CreoleTypes::CHAR, false, 1);
     $tMap->addColumn('COMMENTS', 'Comments', 'string', CreoleTypes::VARCHAR, false, 255);
     $tMap->addForeignKey('PAYMENT_MODEL_ID', 'PaymentModelId', 'int', CreoleTypes::INTEGER, 'payment_model', 'ID', false, null);
     $tMap->addForeignKey('TRANSACTION_STATUS_ID', 'TransactionStatusId', 'int', CreoleTypes::INTEGER, 'transaction_status', 'ID', false, null);
     $tMap->addColumn('PAID_AT', 'PaidAt', 'int', CreoleTypes::DATE, false, null);
     $tMap->addColumn('YEAR', 'Year', 'double', CreoleTypes::NUMERIC, false, 4);
     $tMap->addColumn('MONTH', 'Month', 'string', CreoleTypes::CHAR, false, 1);
     $tMap->addForeignKey('ACADEMIC_COST_COMPONENT_ID', 'AcademicCostComponentId', 'int', CreoleTypes::INTEGER, 'academic_cost_component', 'ID', false, null);
     $tMap->addForeignKey('ACADEMIC_CALENDAR_ID', 'AcademicCalendarId', 'int', CreoleTypes::INTEGER, 'academic_calendar', 'ID', false, null);
 }
开发者ID:taryono,项目名称:school,代码行数:27,代码来源:VSppMapBuilder.php


示例17: doBuild

 /**
  * The doBuild() method builds the DatabaseMap
  *
  * @return     void
  * @throws     PropelException
  */
 public function doBuild()
 {
     $this->dbMap = Propel::getDatabaseMap(JobeetJobPeer::DATABASE_NAME);
     $tMap = $this->dbMap->addTable(JobeetJobPeer::TABLE_NAME);
     $tMap->setPhpName('JobeetJob');
     $tMap->setClassname('JobeetJob');
     $tMap->setUseIdGenerator(true);
     $tMap->addPrimaryKey('ID', 'Id', 'INTEGER', true, null);
     $tMap->addForeignKey('CATEGORY_ID', 'CategoryId', 'INTEGER', 'jobeet_category', 'ID', true, null);
     $tMap->addColumn('TYPE', 'Type', 'VARCHAR', false, 255);
     $tMap->addColumn('COMPANY', 'Company', 'VARCHAR', true, 255);
     $tMap->addColumn('LOGO', 'Logo', 'VARCHAR', false, 255);
     $tMap->addColumn('URL', 'Url', 'VARCHAR', false, 255);
     $tMap->addColumn('POSITION', 'Position', 'VARCHAR', true, 255);
     $tMap->addColumn('LOCATION', 'Location', 'VARCHAR', true, 255);
     $tMap->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', true, null);
     $tMap->addColumn('HOW_TO_APPLY', 'HowToApply', 'LONGVARCHAR', true, null);
     $tMap->addColumn('TOKEN', 'Token', 'VARCHAR', true, 255);
     $tMap->addColumn('IS_PUBLIC', 'IsPublic', 'BOOLEAN', true, null);
     $tMap->addColumn('IS_ACTIVATED', 'IsActivated', 'BOOLEAN', true, null);
     $tMap->addColumn('EMAIL', 'Email', 'VARCHAR', true, 255);
     $tMap->addColumn('EXPIRES_AT', 'ExpiresAt', 'TIMESTAMP', true, null);
     $tMap->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null);
     $tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null);
 }
开发者ID:JimmyVB,项目名称:Symfony-v1.2,代码行数:31,代码来源:JobeetJobMapBuilder.php


示例18: save

 public function save($con = null)
 {
     $con = Propel::getConnection();
     try {
         $con->begin();
         $ret = parent::save($con);
         // update vocabulary_has_user table
         $userId = sfContext::getInstance()->getUser()->getSubscriberId();
         $vocabularyId = $this->getId();
         $mode = sfContext::getInstance()->getRequest()->getParameter('action');
         if ($userId && $vocabularyId) {
             //see if there's already an entry in the table and if not, add it
             $criteria = new Criteria();
             $criteria->add(VocabularyHasUserPeer::USER_ID, $userId);
             $VocabularyHasUsersColl = $this->getVocabularyHasUsers($criteria, $con);
             if (!count($VocabularyHasUsersColl)) {
                 $vocabularyUser = new VocabularyHasUser();
                 $vocabularyUser->setVocabularyId($vocabularyId);
                 $vocabularyUser->setUserId($userId);
                 $vocabularyUser->setIsRegistrarFor(true);
                 $vocabularyUser->setIsAdminFor(true);
                 $vocabularyUser->setIsMaintainerFor(true);
                 $vocabularyUser->save($con);
             }
         }
         $con->commit();
         return $ret;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:32,代码来源:Vocabulary.php


示例19: loadFixtures

 public function loadFixtures($fixtures)
 {
     // initialize database manager
     $databaseManager = new sfDatabaseManager($this);
     // cleanup database
     $db = sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR . '/database.sqlite';
     if (file_exists($db)) {
         unlink($db);
     }
     // initialize database
     $sql = file_get_contents(sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . 'lib.model.schema.sql');
     $sql = preg_replace('/^\\s*\\-\\-.+$/m', '', $sql);
     $sql = preg_replace('/^\\s*DROP TABLE .+?$/m', '', $sql);
     $con = Propel::getConnection();
     $tables = preg_split('/CREATE TABLE/', $sql);
     foreach ($tables as $table) {
         $table = trim($table);
         if (!$table) {
             continue;
         }
         $con->executeQuery('CREATE TABLE ' . $table);
     }
     // load fixtures
     $data = new sfPropelData();
     if (is_array($fixtures)) {
         $data->loadDataFromArray($fixtures);
     } else {
         $data->loadData(sfConfig::get('sf_data_dir') . '/' . $fixtures);
     }
 }
开发者ID:ajith24,项目名称:ajithworld,代码行数:30,代码来源:ProjectConfiguration.class.php


示例20: doBuild

 /**
  * The doBuild() method builds the DatabaseMap
  *
  * @return     void
  * @throws     PropelException
  */
 public function doBuild()
 {
     $this->dbMap = Propel::getDatabaseMap(PatientPeer::DATABASE_NAME);
     $tMap = $this->dbMap->addTable(PatientPeer::TABLE_NAME);
     $tMap->setPhpName('Patient');
     $tMap->setClassname('Patient');
     $tMap->setUseIdGenerator(true);
     $tMap->addPrimaryKey('ID', 'Id', 'INTEGER', true, 11);
     $tMap->addColumn('ID_NUMBER', 'IdNumber', 'VARCHAR', false, 20);
     $tMap->addColumn('CNIC', 'Cnic', 'VARCHAR', false, 25);
     $tMap->addColumn('USERNAME', 'Username', 'VARCHAR', false, 50);
     $tMap->addColumn('PASSWORD', 'Password', 'VARCHAR', false, 50);
     $tMap->addColumn('NAME', 'Name', 'VARCHAR', false, 100);
     $tMap->addColumn('FATHER_NAME', 'FatherName', 'VARCHAR', false, 50);
     $tMap->addColumn('DOB', 'Dob', 'DATE', false, null);
     $tMap->addColumn('GENDER', 'Gender', 'VARCHAR', false, 10);
     $tMap->addColumn('ADDRESS', 'Address', 'VARCHAR', false, 255);
     $tMap->addColumn('CONTACT_RES', 'ContactRes', 'VARCHAR', false, 20);
     $tMap->addColumn('CONTACT_CELL', 'ContactCell', 'VARCHAR', false, 20);
     $tMap->addColumn('EMERGENCY_CONTACT', 'EmergencyContact', 'VARCHAR', false, 20);
     $tMap->addColumn('EMAIL', 'Email', 'VARCHAR', false, 100);
     $tMap->addColumn('BLOOD_GROUP', 'BloodGroup', 'VARCHAR', false, 5);
     $tMap->addColumn('DISEASE', 'Disease', 'VARCHAR', false, 255);
     $tMap->addColumn('ALLERGY', 'Allergy', 'VARCHAR', false, 255);
     $tMap->addColumn('DRUG_ALLERGY', 'DrugAllergy', 'VARCHAR', false, 255);
     $tMap->addColumn('STATUS', 'Status', 'VARCHAR', false, 10);
     $tMap->addColumn('CREATED_AT', 'CreatedAt', 'DATE', false, null);
     $tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'DATE', false, null);
 }
开发者ID:lejacome,项目名称:hospital-mgt,代码行数:35,代码来源:PatientMapBuilder.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP PropelCollection类代码示例发布时间:2022-05-23
下一篇:
PHP Propal类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap