No matches in properties

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • homeempire
    Senior Member
    • Sep 2014
    • 181

    No matches in properties

    Hi.

    I don't see matches in Property. But I see matches in Request.
    I try fresh install of real estate extension and the same problem.

    I found that when I delete from Services/RealEstateProperty.php this part:
    PHP Code:
    if ($entity->get('square') !== null) {
                $selectParams['whereClause'][] = array(
                    'OR' => [
                        array(
                            'fromSquare!=' => null,
                            'toSquare!=' => null,
                            'fromSquare<=' => $entity->get('square'),
                            'toSquare>=' => $entity->get('square')
                        ),
                        array(
                            'fromSquare!=' => null,
                            'toSquare=' => null,
                            'fromSquare<=' => $entity->get('square'),
                        ),
                        array(
                            'fromSquare=' => null,
                            'toSquare!=' => null,
                            'toSquare>=' => $entity->get('square'),
                        ),
                        array(
                            'fromSquare=' => null,
                            'toSquare=' => null
                        )
                    ]
                );
            } else {
                $selectParams['whereClause'][] = array(
                    'fromSquare=' => null,
                    'toSquare=' => null
                );
            }
    
            if ($entity->get('yearBuilt') !== null) {
                $selectParams['whereClause'][] = array(
                    'OR' => [
                        array(
                            'fromYearBuilt!=' => null,
                            'toYearBuilt!=' => null,
                            'fromYearBuilt<=' => $entity->get('yearBuilt'),
                            'toYearBuilt>=' => $entity->get('yearBuilt')
                        ),
                        array(
                            'fromYearBuilt!=' => null,
                            'toYearBuilt=' => null,
                            'fromYearBuilt<=' => $entity->get('yearBuilt'),
                        ),
                        array(
                            'fromYearBuilt=' => null,
                            'toYearBuilt!=' => null,
                            'toYearBuilt>=' => $entity->get('yearBuilt'),
                        ),
                        array(
                            'fromYearBuilt=' => null,
                            'toYearBuilt=' => null
                        )
                    ]
                );
            } else {
                $selectParams['whereClause'][] = array(
                    'fromYearBuilt=' => null,
                    'toYearBuilt=' => null
                );
            }
    
            if ($entity->get('floor') !== null) {
                $selectParams['whereClause'][] = array(
                    'OR' => [
                        array(
                            'fromFloor!=' => null,
                            'toFloor!=' => null,
                            'fromFloor<=' => $entity->get('floor'),
                            'toFloor>=' => $entity->get('floor')
                        ),
                        array(
                            'fromFloor!=' => null,
                            'toFloor=' => null,
                            'fromFloor<=' => $entity->get('floor'),
                        ),
                        array(
                            'fromFloor=' => null,
                            'toFloor!=' => null,
                            'toFloor>=' => $entity->get('floor'),
                        ),
                        array(
                            'fromFloor=' => null,
                            'toFloor=' => null
                        )
                    ]
                );
            } else {
                $selectParams['whereClause'][] = array(
                    'fromFloor=' => null,
                    'toFloor=' => null
                );
            }
    
            if ($entity->get('floorCount') !== null) {
                $selectParams['whereClause'][] = array(
                    'OR' => [
                        array(
                            'fromFloorCount!=' => null,
                            'toFloorCount!=' => null,
                            'fromFloorCount<=' => $entity->get('floorCount'),
                            'toFloorCount>=' => $entity->get('floorCount')
                        ),
                        array(
                            'fromFloorCount!=' => null,
                            'toFloorCount=' => null,
                            'fromFloorCount<=' => $entity->get('floorCount'),
                        ),
                        array(
                            'fromFloorCount=' => null,
                            'toFloorCount!=' => null,
                            'toFloorCount>=' => $entity->get('floorCount'),
                        ),
                        array(
                            'fromFloorCount=' => null,
                            'toFloorCount=' => null
                        )
                    ]
                );
            } else {
                $selectParams['whereClause'][] = array(
                    'fromFloorCount=' => null,
                    'toFloorCount=' => null
                );
            }
    
            if ($entity->get('bedroomCount') !== null) {
                $selectParams['whereClause'][] = array(
                    'OR' => [
                        array(
                            'fromBedroomCount!=' => null,
                            'toBedroomCount!=' => null,
                            'fromBedroomCount<=' => $entity->get('bedroomCount'),
                            'toBedroomCount>=' => $entity->get('bedroomCount')
                        ),
                        array(
                            'fromBedroomCount!=' => null,
                            'toBedroomCount=' => null,
                            'fromBedroomCount<=' => $entity->get('bedroomCount'),
                        ),
                        array(
                            'fromBedroomCount=' => null,
                            'toBedroomCount!=' => null,
                            'toBedroomCount>=' => $entity->get('bedroomCount'),
                        ),
                        array(
                            'fromBedroomCount=' => null,
                            'toBedroomCount=' => null
                        )
                    ]
                );
            } else {
                $selectParams['whereClause'][] = array(
                    'fromBedroomCount=' => null,
                    'toBedroomCount=' => null
                );
            }
    
            if ($entity->get('bathroomCount') !== null) {
                $selectParams['whereClause'][] = array(
                    'OR' => [
                        array(
                            'fromBathroomCount!=' => null,
                            'toBathroomCount!=' => null,
                            'fromBathroomCount<=' => $entity->get('bathroomCount'),
                            'toBathroomCount>=' => $entity->get('bathroomCount')
                        ),
                        array(
                            'fromBathroomCount!=' => null,
                            'toBathroomCount=' => null,
                            'fromBathroomCount<=' => $entity->get('bathroomCount'),
                        ),
                        array(
                            'fromBathroomCount=' => null,
                            'toBathroomCount!=' => null,
                            'toBathroomCount>=' => $entity->get('bathroomCount'),
                        ),
                        array(
                            'fromBathroomCount=' => null,
                            'toBathroomCount=' => null
                        )
                    ]
                );
            } else {
                $selectParams['whereClause'][] = array(
                    'fromBathroomCount=' => null,
                    'toBathroomCount=' => null
                );
            } 
    
    ...matches apear - with obviously incorrect values ​​for these deleted part of code.

    Any idea?
  • homeempire
    Senior Member
    • Sep 2014
    • 181

    #2
    Ok i found that problem is when I don't set any location in Request.

    Comment

    Working...