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


PHP Action::getId方法代码示例

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


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

示例1: prune

 /**
  * Exclude object from result
  *
  * @param   Action $action Object to remove from the list of results
  *
  * @return ActionQuery The current query, for fluid interface
  */
 public function prune($action = null)
 {
     if ($action) {
         $this->addUsingAlias(ActionPeer::ID, $action->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
开发者ID:Halfnhav4,项目名称:datawrapper,代码行数:14,代码来源:BaseActionQuery.php

示例2: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Action $obj A Action object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         ActionPeer::$instances[$key] = $obj;
     }
 }
开发者ID:Halfnhav4,项目名称:datawrapper,代码行数:22,代码来源:BaseActionPeer.php

示例3: Action

 * and let it sit.
 *
 * Now that we're displaying reports and stats, these old tickets
 * are skewing the stats.  We need to try and close them out, but
 * still give them some reasonable dates so they don't skew the stats
 *
 * These old tickets do not usually pass validation, so we have to do
 * raw SQL queries to do the work.
 *
 * @copyright 2012 City of Bloomington, Indiana
 * @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
 * @author Cliff Ingham <inghamn@bloomington.in.gov>
 */
include '../configuration.inc';
$zend_db = Database::getConnection();
$closedAction = new Action('close');
$cutoff_date = '2009-01-01';
$sql = "select t.id, t.enteredDate, t.assignedPerson_id\n\t\tfrom tickets t\n\t\twhere t.status='open'\n\t\tand t.enteredDate<'{$cutoff_date}'";
$result = $zend_db->fetchAll($sql);
foreach ($result as $row) {
    $sql = 'select max(actionDate) from ticketHistory where ticket_id=?';
    $actionDate = $zend_db->fetchOne($sql, array($row['id']));
    $history = array('ticket_id' => $row['id'], 'actionPerson_id' => $row['assignedPerson_id'], 'action_id' => $closedAction->getId(), 'actionDate' => $actionDate ? $actionDate : $row['enteredDate'], 'notes' => '[data cleanup] Closed old ticket from ReqPro');
    $zend_db->insert('ticketHistory', $history);
    $zend_db->update('tickets', array('status' => 'closed'), 'id=' . $row['id']);
    $ticket = new Ticket($row['id']);
    $search = new Search();
    $search->add($ticket);
    $search->solrClient->commit();
    echo "{$row['id']} {$row['enteredDate']} {$history['actionDate']}\n";
}
开发者ID:CodeForEindhoven,项目名称:uReport,代码行数:31,代码来源:closeOldTickets.php

示例4: on

 * When we originally imported them, they received a mix of
 * 1970-01-01 (the original unix timestamp) and CURRENT_TIME
 *
 * We don't know when these things were originally entered, but
 * cannot leave the date as zero.  So, we're setting all dates on
 * these tickets to 1970-01-01.
 */
$sql = "select t.id,t.enteredDate,h.enteredDate,h.actionDate\n\t\tfrom tickets t\n\t\tleft join ticketHistory h on (t.id=h.ticket_id and h.action_id=?)\n\t\twhere t.enteredDate='1970-01-01'";
$result = $zend_db->fetchAll($sql, $openAction->getId());
foreach ($result as $row) {
    $zend_db->update('ticketHistory', array('enteredDate' => '1970-01-01', 'actionDate' => '1970-01-01', 'notes' => '[data cleanup] Dates were missing and have been set to 1970'), "ticket_id={$row['id']}");
    echo "{$row['id']} set to 1970-01-01\n";
}
/**
 * A ton a records are closed, yet do not have a ticketHistory with a closed action
 * We are relying on the ticketHistory date for Reporting, so we need to have dates set
 * We're going to have to just invent the close date
 * This should use the date of the last TicketHistory, if available,
 * otherwise it will set the close date as the same as the Ticket enteredDate
 */
$sql = "select t.id, t.enteredDate, t.assignedPerson_id\n\t\tfrom tickets t\n\t\tleft join ticketHistory h on t.id=h.ticket_id and h.action_id=?\n\t\twhere t.status='closed' and h.actionDate is null";
$result = $zend_db->fetchAll($sql, $closedAction->getId());
foreach ($result as $row) {
    $sql = 'select max(actionDate) from ticketHistory where ticket_id=?';
    $actionDate = $zend_db->fetchOne($sql, array($row['id']));
    $history = array('ticket_id' => $row['id'], 'actionPerson_id' => $row['assignedPerson_id'], 'action_id' => $closedAction->getId(), 'actionDate' => $actionDate ? $actionDate : $row['enteredDate'], 'notes' => '[data cleanup] Closing date was missing and has been provided by the system as a best guess');
    $zend_db->insert('ticketHistory', $history);
    echo "{$row['id']} {$row['enteredDate']} {$history['actionDate']}\n";
}
$q = $zend_db->query('update tickets set latitude=null, longitude=null where latitude=0');
$q->execute();
开发者ID:CodeForEindhoven,项目名称:uReport,代码行数:31,代码来源:5_cleanup.php


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