code: public function getTotal()
      {
          if (!$this->isReady()) {
              return 0;
          }
          if (is_null($this->_countTotal)) {
              $this->_countTotal = 0;
              if (in_array($this->settings['direction'], ['to_local', 'both'])) {
                  $this->_countTotal += count($this->foreignDataItems);
              }
  
              if (in_array($this->settings['direction'], ['to_foreign', 'both'])) {
                  $this->_countTotal += count($this->localDataItems);
              }
          }
  
          return $this->_countTotal;
      }
docs: Get total.
  
  @return [[@doctodo return_type:getTotal]] [[@doctodo return_description:getTotal]]