/** * model name if suit or not * @param $gpjModelName * @param $otherModelName * @param $otherYearModel * @return bool */ private function modelNameSuit($gpjModelName, $otherModelName, $otherYearModel) { $yearModel = mb_substr($gpjModelName, 0, 5); $gpjModelName = mb_substr($gpjModelName, 6); $gpjModelName = parent::modelNameAdjustment($gpjModelName); $otherModelName = parent::modelNameAdjustment($otherModelName); $gpjModelArray = array_filter(explode(' ', strtoupper($gpjModelName))); $otherModelArray = array_filter(explode(' ', strtoupper($otherModelName))); $intersect = array_values(array_intersect($gpjModelArray, $otherModelArray)); if (($intersect == $gpjModelArray || $intersect == $otherModelArray) && $yearModel == $otherYearModel) { return true; } return false; }
/** * model name if suit or not * @param $gpjModel * @param $che300Model * @return bool */ private function modelNameSuit($gpjModel, $che300Model) { $gpjModel = parent::modelNameAdjustment($gpjModel); $che300Model = parent::modelNameAdjustment($che300Model); $gpjModelElements = array_values(array_filter(explode(' ', strtoupper($gpjModel)))); $che300ModelElements = array_values(array_filter(explode(' ', strtoupper($che300Model)))); $intersect = array_values(array_intersect($gpjModelElements, $che300ModelElements)); if ($intersect == $gpjModelElements || $intersect == $che300ModelElements) { return true; } return false; }