@@ 593-602 (lines=10) @@ | ||
590 | * @param array|null $columns |
|
591 | * @return array |
|
592 | */ |
|
593 | protected function getCachedRawAttributes(array $columns = null) |
|
594 | { |
|
595 | $cachedAttributes = $this->getCache()->get($this->getEntityId()); |
|
596 | ||
597 | if (is_null($columns)) { |
|
598 | return $cachedAttributes; |
|
599 | } else { |
|
600 | return array_only($cachedAttributes, $columns); |
|
601 | } |
|
602 | } |
|
603 | ||
604 | /** |
|
605 | * Return a single attribute from the cache |
|
@@ 609-618 (lines=10) @@ | ||
606 | * @param string $key |
|
607 | * @return mixed |
|
608 | */ |
|
609 | protected function getCachedAttribute($key) |
|
610 | { |
|
611 | $cachedAttributes = $this->getCache()->get($this->getEntityId()); |
|
612 | ||
613 | if (!array_key_exists($key, $cachedAttributes)) { |
|
614 | return null; |
|
615 | } else { |
|
616 | return $cachedAttributes[$key]; |
|
617 | } |
|
618 | } |
|
619 | ||
620 | /** |
|
621 | * Convert related Entity's attributes to foreign keys |