本文整理汇总了PHP中Transaction::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Transaction::getId方法的具体用法?PHP Transaction::getId怎么用?PHP Transaction::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::getId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testWritingATransactionWillReturnTransactionWithIdSet
public function testWritingATransactionWillReturnTransactionWithIdSet()
{
//txn before the write
$this->assertNull($this->transaction->getId());
$this->journalist->expects($this->once())->method('writeTransaction')->will($this->returnValue(new IntType(1)));
$txn = $this->sut->write($this->transaction);
//txn after the write
$this->assertInstanceOf('SAccounts\\Transaction\\SimpleTransaction', $txn);
$this->assertInstanceOf('Chippyash\\Type\\Number\\IntType', $txn->getId());
$this->assertEquals(1, $txn->getId()->get());
}
示例2: save
public function save()
{
$Transaction = new Transaction($this->data->Transaction);
$Transaction->save();
$go = '>auth/Transaction/formObject/' . $Transaction->getId();
$this->renderPrompt('information', 'OK', $go);
}
示例3: fromTransaction
public static function fromTransaction(Transaction $transaction, PropelPDO $con = null)
{
$transactionId = $transaction->getId();
$bookingData = array();
$bookings = BookingQuery::create()->filterByTransactionId($transactionId)->find($con);
foreach ($bookings as $booking) {
$bookingData[] = self::from($booking, $con);
}
$clockingData = array();
$clockings = ClockingQuery::create()->joinTransactionClocking()->joinWith('ClockingType')->add(TransactionClockingPeer::TRANSACTION_ID, $transactionId)->find($con);
foreach ($clockings as $clocking) {
$clockingData[] = self::from($clocking, $con) + array('Type' => self::from($clocking->getClockingType($con), $con));
}
return array('Start' => $transaction->getStart('U'), 'End' => $transaction->getEnd('U'), 'Bookings' => $bookingData, 'Clockings' => $clockingData, 'User' => self::from($transaction->getUserRelatedByUserId($con), $con)) + $transaction->toArray();
}
示例4: forTransaction
public static function forTransaction(Transaction $transaction, $url_success = '')
{
$u_id = $transaction->getIdReceiver();
$u = UserTable::getInstance()->findOneById($u_id);
switch ($u->getUtype()) {
case 'puser':
$onpay_login = SettingTable::getInstance()->findOneByName('pOnpayLogin')->getValue();
$private_code = SettingTable::getInstance()->findOneByName('pApiCode')->getValue();
break;
case 'uuser':
$onpay_login = SettingTable::getInstance()->findOneByName('uOnpayLogin')->getValue();
$private_code = SettingTable::getInstance()->findOneByName('uApiCode')->getValue();
break;
default:
throw new sfException('Неизвестный тип пользователя в транзакции при инициализации платежа OnPay');
break;
}
return new OnPay($onpay_login, $private_code, $transaction->getId(), $transaction->getAmount(), $url_success);
}
示例5: testRollback_HasTransactionId_SendsDelete
public function testRollback_HasTransactionId_SendsDelete()
{
$transaction = new Transaction($this->client);
$transaction->setId(321);
$this->transport->expects($this->once())->method('delete')->with('/transaction/' . $transaction->getId())->will($this->returnValue(array("code" => 200)));
$this->client->rollbackTransaction($transaction);
}
示例6: setTransaction
/**
* Declares an association between this object and a Transaction object.
*
* @param Transaction $v
* @return TransactionClocking The current object (for fluent API support)
* @throws PropelException
*/
public function setTransaction(Transaction $v = null)
{
if ($v === null) {
$this->setTransactionId(NULL);
} else {
$this->setTransactionId($v->getId());
}
$this->aTransaction = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Transaction object, it will not be re-added.
if ($v !== null) {
$v->addTransactionClocking($this);
}
return $this;
}
示例7: 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 Transaction $obj A Transaction 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
TransactionPeer::$instances[$key] = $obj;
}
}
示例8: filterByTransaction
/**
* Filter the query by a related Transaction object
*
* @param Transaction|PropelObjectCollection $transaction The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return TransactionClockingQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByTransaction($transaction, $comparison = null)
{
if ($transaction instanceof Transaction) {
return $this->addUsingAlias(TransactionClockingPeer::TRANSACTION_ID, $transaction->getId(), $comparison);
} elseif ($transaction instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(TransactionClockingPeer::TRANSACTION_ID, $transaction->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByTransaction() only accepts arguments of type Transaction or PropelCollection');
}
}
示例9: prune
/**
* Exclude object from result
*
* @param Transaction $transaction Object to remove from the list of results
*
* @return TransactionQuery The current query, for fluid interface
*/
public function prune($transaction = null)
{
if ($transaction) {
$this->addUsingAlias(TransactionPeer::ID, $transaction->getId(), Criteria::NOT_EQUAL);
}
return $this;
}