本文整理汇总了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;
}
示例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;
}
}
示例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";
}
示例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();