Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 399
Zeile 686... Zeile 686...
686
 
686
 
687
        if (empty($ids)) {
687
        if (empty($ids)) {
688
            return $this->getRelated()->newCollection();
688
            return $this->getRelated()->newCollection();
Zeile 689... Zeile 689...
689
        }
689
        }
690
 
690
 
691
        return $this->whereIn(
691
        return $this->whereKey(
692
            $this->getRelated()->getQualifiedKeyName(), $this->parseIds($ids)
692
            $this->parseIds($ids)
Zeile 693... Zeile 693...
693
        )->get($columns);
693
        )->get($columns);
694
    }
694
    }
Zeile 1151... Zeile 1151...
1151
     *
1151
     *
1152
     * @return void
1152
     * @return void
1153
     */
1153
     */
1154
    public function touch()
1154
    public function touch()
1155
    {
1155
    {
1156
        $key = $this->getRelated()->getKeyName();
-
 
1157
 
-
 
1158
        $columns = [
1156
        $columns = [
1159
            $this->related->getUpdatedAtColumn() => $this->related->freshTimestampString(),
1157
            $this->related->getUpdatedAtColumn() => $this->related->freshTimestampString(),
1160
        ];
1158
        ];
Zeile 1161... Zeile 1159...
1161
 
1159
 
1162
        // If we actually have IDs for the relation, we will run the query to update all
1160
        // If we actually have IDs for the relation, we will run the query to update all
1163
        // the related model's timestamps, to make sure these all reflect the changes
1161
        // the related model's timestamps, to make sure these all reflect the changes
1164
        // to the parent models. This will help us keep any caching synced up here.
1162
        // to the parent models. This will help us keep any caching synced up here.
1165
        if (count($ids = $this->allRelatedIds()) > 0) {
1163
        if (count($ids = $this->allRelatedIds()) > 0) {
1166
            $this->getRelated()->newQueryWithoutRelationships()->whereIn($key, $ids)->update($columns);
1164
            $this->getRelated()->newQueryWithoutRelationships()->whereKey($ids)->update($columns);
1167
        }
1165
        }
Zeile 1168... Zeile 1166...
1168
    }
1166
    }
1169
 
1167