...multiple actions. [ 'caption' => $helper->__('Utilization'), 'popup' => true, // Popup new browser window. 'url' => [ 'base' => '*/*/utilization', 'params' => [ 'member_id' => $this->getMemberId(), //'plan_id => $row->getPlanId(), // No can do! ] ], 'field' => 'company_id' // Merge...
...to params: 'company_id' => $row->getCompanyId() ] ], 'filter' => false, 'sortable' => false, ]); Use callback to construct the URL: $this->addColumn('action', [ 'header' => $helper->__('Action'), 'width' => '50px', 'type' => 'action', 'getter' => [$this, 'getFilterParams'], 'actions...
...app\code\core\Mage\Core\Model\App.php Mage_Core_Model_App /** * Saving cache data * * @param mixed $data * @param string $id * @param array $tags * @param null|false|int $lifeTime * @return $this...
...CACHE_TAG will be added: // app\code\core\Mage\Core\Model\Cache.php /** * Save data * * @param string $data * @param string $id * @param array $tags * @param null|false|int $lifeTime * @return bool...
...is' => new Zend_Db_Expr('NULL')] Complex Conditions 1 /** * Filter by ((condition1) OR (condition2)) * * @param int $studentId * @return $this */ public function filterLanguage($studentId) { /** * condition1: include all courses without language requirement...
...prefix` = 'claim') AND (`object_id` = '1') * OR * (`prefix` = 'claim_item') AND (`parent_id` = '1') * ) * @param string $parentPrefix * @param string $childPrefix * @param int $objectId * @return $this */ public function filterParentChild($parentPrefix, $childPrefix...
...doc_no', 'mc_status')) ->addAttributeToFilter($attributes, null, 'left') ->setOrder('created_at', 'desc') ; Short Array: /** * @param string $query * @param bool $exactMatch * @return $this */ public function filterTdnOrNic($query, $exactMatch = false) { if ($exactMatch...
...group') AND (at_medical_group_id.value = '938') )) Sort Order in EAV Collection /** * Filter by group name(s). * * @param string|string[] * @return $this * @throws Mage_Core_Exception * @throws Mage_Core_Model_Store_Exception * @throws...
...Zend_Json_Server_Request_Http Object ( [_rawJson:protected] => {"jsonrpc":"2.0","method":"customerGroupList","id":"60efafaaed751","params":["15c64c1d73bed7682227d1f1159afc00"]} [_id:protected] => 60efafaaed751 [_isMethodError:protected] => [_method:protected] => customerGroupList [_methodRegex:protected] => /^[a-z][a-z0...
[_params:protected] => Array ( [0] => 15c64c1d73bed7682227d1f1159afc00 ) [_version:protected] => 2.0 ) rawJson { "jsonrpc": "2.0", "method": "customerGroupList", "id": "60efafaaed751", "params": [ "15c64c1d73bed7682227d1f1159afc00" ] } Response: object(stdClass)#672 (3) { ["error"] => object(stdClass)#674 (3) { ["code"] => int...
...Catalog_CategoryController:: _initCategory() * * Redirect category view to product view if customer has Product ID. * * @param Varien_Event_Observer $observer */ public function categoryInitAfter($observer) { /** @var Mage_Catalog_Model_Category $category */ $category...
...if ($pid = $customer->getProductId()) { /** @var Mage_Catalog_CategoryController $controller */ $controller = $observer->getControllerAction(); /** * Prevent setting param 'id' to category ID. Required only if forward. * @see Mage_Core_Controller_Varien_Router_Standard...
...input elements for search criteria in frontend grid with pagination block 'page/html_pager', the search params will be lost when the user click on page n. This is because the URL...
...links in the pager do not contain the search params. There are 3 solutions: Do not Use POST in form Simple JS Solution This can be fixed easily with js...
...core\Mage\CatalogInventory\Model\Resource\Stock.php /** * Correct particular stock products qty based on operator * * @param Mage_CatalogInventory_Model_Stock $stock * @param array $productQtys * @param string $operator +/- * @return $this */ public function...
...race condition. * Note: $write->insertOnDuplicate() or $write->update() at adapter level doesn't work. * * @param Sxx_AccountPayment_Model_Ledger $ledger * @return float * @throws Exception */ protected function _fetchNewBalance(Sxx_AccountPayment_Model...
The addition of head elements for Vue are dependent on the helper method which returns a bool.
...Mage_Catalog_Model_Product_Option { /** * Get group name of option by given option type * * @param string $type * @return array */ public function getGroupByType($type = null) { if (is_null($type)) { $type = $this...
'source' => 'source', 'country'=> 'source', ); return isset($optionGroupsToTypes[$type])?$optionGroupsToTypes[$type]:''; } /** * Group model factory * * @param string $type Option type * @return Mage_Catalog_Model_Product_Option_Group_Abstract */ public function groupFactory...
...event-observer: /** * Event 'checkout_cart_product_add_before' * @see Mage_Checkout_Model_Cart ::addProduct() * * @param Varien_Event_Observer $observer * @return void */ public function beforeAddToCart(Varien_Event_Observer $observer) { if (Mage...
...catch (Exception $e) { Mage::throwException($e->getMessage()); return $this; } Validator: /** * Add validators for uploading * * @param Mage_Core_Model_File_Uploader $uploader */ protected function addValidators(Mage_Core_Model_File_Uploader $uploader...
...uploader->addValidateCallback('size', $this, 'validateMaxSize'); } /** * Validation callback for checking max file size * * @param string $filePath Path to temporary uploaded file * @throws Mage_Core_Exception */ public function validateMaxSize($filePath) { if ($this...
...rendering dynamic content when cache is enable * @see Mage_Catalog_Block_Category_View ::getCmsBlockHtml() * * @param int $id * @return $this */ public function setBlockId($id) { $this->setData('block_id', $id); $block = Mage...
...until it is less than 25KB and saved as tmp.jpg * Original image is unchanged * * @param string fullpath and filename * @return string fullpath tmp.jpg that is saved */ protected function _resizeImage($fnm...
Best results in other decks
The new params.expect method in Rails 8 improves parameter filtering, addressing issues with malformed input and enhancing security. It provides a cleaner, more explicit way to enforce the structure and...
...types of incoming parameters. What changed Replaces require and permit: Combines both methods for concise parameter validation. Explicit Array Handling: Requires double array syntax to define arrays of hashes, improving...
...If different, it would redirect users to the generated/expected path. expected_path = url_for(params.to_unsafe_h) # ❌ this is not safe! if expected_path != request.original_fullpath redirect_to expected_path...
...an Open Redirect vulnerability. It's as simple as passing a host=evil.tld URL parameter. Rails would see url_for(..., host: "evil.tld") and happily generate a URL to that foreign...