44 if (empty($identifyingFields)) {
45 throw new \Magento\Framework\Exception\InputException(
__(
'Identifying Fields required'));
47 if (!$object->getId()) {
48 throw new \Magento\Framework\Exception\InputException(
__(
'An ID is needed. Set the ID and try again.'));
50 $this->storageMapper[$storageName][$this->
getHash($identifyingFields)] = $object->getId();
51 $this->registry[$object->getId()] = $object;
71 public function get(
$id)
74 return $this->registry[
$id];
88 $hash = $this->
getHash($identifyingFields);
89 if (isset($this->storageMapper[$storageName][$hash])) {
90 return $this->
get($this->storageMapper[$storageName][$hash]);
101 public function remove(
$id)
104 unset($this->registry[
$id]);
116 return isset($this->registry[
$id]);
127 $stringForKey = implode(self::GLUE,
$fields);
128 return sha1($stringForKey);
getByIdentifyingFields(array $identifyingFields, $storageName)
addByIdentifyingFields(FrameworkAbstractModel $object, array $identifyingFields, $storageName)