protected function getDuplicatesByField($field)
    {
        $duplicates = DataList::create(self::class)
            ->filter(
                [
                    $field   => $this->$field,
                    'BlogID' => (int) $this->BlogID
                ]
            );

        if ($this->ID) {
            $duplicates = $duplicates->exclude('ID', $this->ID);
        }

        return $duplicates;
    }
protected function getDuplicatesByField($field)
    {
        $duplicates = DataList::create(self::class)
            ->filter(
                [
                    $field   => $this->$field,
                    'BlogID' => (int) $this->BlogID
                ]
            );

        if ($this->ID) {
            $duplicates = $duplicates->exclude('ID', $this->ID);
        }

        return $duplicates;
    }
protected function getDuplicatesByField ( $ field ) { $ duplicates = DataList :: create ( self :: class ) -> filter ( [ $ field => $ this -> $ field , 'BlogID' => ( int ) $ this -> BlogID ] ) ; if ( $ this -> ID ) { $ duplicates = $ duplicates -> exclude ( 'ID' , $ this -> ID ) ; } return $ duplicates ; }
Looks for objects o the same type and the same value by the given Field

@param  string $field E.g. URLSegment or Title
@return DataList
Looks for objects o the same type and the same value by the given Field