code: public function getLocalObject($localModelClass, $foreignPrimaryKey)
      {
          $dataSource = $this->getLocalDataSource($localModelClass);
          if (is_array($foreignPrimaryKey) && isset($foreignPrimaryKey['localId'])) {
              $registryClass = Yii::$app->classes['Registry'];
  
              return $registryClass::getObject($foreignPrimaryKey['localId'], false);
          }
          if ($dataSource && ($foreignDataItem = $dataSource->getForeignDataItem($foreignPrimaryKey))) {
              return $foreignDataItem->handle(true);
          }
  
          return false;
      }
docs: Get local object.
  
  @param [[@doctodo param_type:localModelClass]]   $localModelClass   [[@doctodo param_description:localModelClass]]
  @param [[@doctodo param_type:foreignPrimaryKey]] $foreignPrimaryKey [[@doctodo param_description:foreignPrimaryKey]]
  
  @return [[@doctodo return_type:getLocalObject]] [[@doctodo return_description:getLocalObject]]