本文整理汇总了PHP中Includes\Utils\ArrayManager::findValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayManager::findValue方法的具体用法?PHP ArrayManager::findValue怎么用?PHP ArrayManager::findValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Includes\Utils\ArrayManager
的用法示例。
在下文中一共展示了ArrayManager::findValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assignLastPaymentMethod
/**
* Assign last used payment method
*
* @return \XLite\Model\Payment\Transaction|void
*/
protected function assignLastPaymentMethod()
{
$found = null;
if ($this->isPaymentMethodRequired() && $this->getProfile() && $this->getProfile()->getLastPaymentId()) {
$paymentMethods = $this->getPaymentMethods();
$found = \Includes\Utils\ArrayManager::findValue($paymentMethods, array($this, 'checkLastPaymentMethod'), $this->getProfile()->getLastPaymentId());
}
return $found ? $this->getFirstOpenPaymentTransaction() : null;
}
示例2: showReorder
/**
* Check if the re-order button is shown
*
* @param \XLite\Model\Order $order Order
*
* @return boolean
*/
protected function showReorder(\XLite\Model\Order $order)
{
$items = $order->getItems();
return (bool) \Includes\Utils\ArrayManager::findValue($items, array($this, 'checkIsAvailableToOrder'), false);
}
示例3: getMembershipErrors
/**
* Get the errors which are connected with the membership of the user who placed the order
*
* @param \XLite\Model\Order $order
*
* @return array
*/
protected function getMembershipErrors(\XLite\Model\Order $order)
{
$found = true;
$memberships = $this->getMemberships();
// Memberhsip
if (0 < count($memberships)) {
$membership = $order->getProfile() ? $order->getProfile()->getMembership() : null;
$found = $membership ? \Includes\Utils\ArrayManager::findValue($memberships, array($this, 'checkMembershipId'), $membership->getMembershipId()) : false;
}
return $found ? array() : array(static::ERROR_MEMBERSHIP);
}
示例4: getItemBySKU
/**
* Returns item by sku
*
* @param string $sku Sku
*
* @return array
*/
protected function getItemBySKU($sku)
{
$items = $this->getOrder()->getItems();
return \Includes\Utils\ArrayManager::findValue($items, array($this, 'checkItemSKUEqual'), $sku);
}