code: public function save(Mapper $mapper, $object)
      {
          $identifier = $mapper->getMap()->getIdentifier();
          $data       = $mapper->getMap()->getData($object);
          if ($data[$identifier]) {
              return $this->update($mapper, $data);
          }
          return $this->insert($mapper, $object, $data);
      }
docs: Persists $object
  
  @param Mapper $mapper Mapper
  @param object $object Object to be saved
  
  @return Insert|Update