Beispiel #1
0
 /**
  * Function searches the records in the module, if parentId & parentModule
  * is given then searches only those records related to them.
  * @param <String> $searchValue - Search value
  * @param <Integer> $parentId - parent recordId
  * @param <String> $parentModule - parent module name
  * @return <Array of Vtiger_Record_Model>
  */
 public function searchRecord($searchValue, $parentId = false, $parentModule = false, $relatedModule = false)
 {
     $matchingRecords = parent::searchRecord($searchValue, $parentId, $parentModule, $relatedModule);
     if (!empty($parentId) && !empty($parentModule)) {
         unset($matchingRecords[$relatedModule][$parentId]);
     }
     return $matchingRecords;
 }
Beispiel #2
0
 /**
  * Function searches the records in the module, if parentId & parentModule
  * is given then searches only those records related to them.
  * @param <String> $searchValue - Search value
  * @param <Integer> $parentId - parent recordId
  * @param <String> $parentModule - parent module name
  * @return <Array of Vtiger_Record_Model>
  */
 public function searchRecord($searchValue, $parentId = false, $parentModule = false, $relatedModule = false)
 {
     if (!empty($searchValue) && empty($parentId) && empty($parentModule) && in_array($relatedModule, getInventoryModules())) {
         $matchingRecords = Products_Record_Model::getSearchResult($searchValue, $this->getName());
     } else {
         return parent::searchRecord($searchValue);
     }
     return $matchingRecords;
 }