code: public function setCreatedRange($createdRange)
      {
          if ($createdRange instanceof DateTimeRange) {
              $this->createdRange = $createdRange;
          } elseif (is_array($createdRange)) {
              $this->createdRange = new DateTimeRange($createdRange);
          } else {
              $this->createdRange = null;
              trigger_error('Argument must be an object of class DateTimeRange. Data loss!', E_USER_WARNING);
          }
  
          return $this;
      }
docs: Sets the "createdRange" of the Search.
  
  @param DateTimeRange $createdRange
  
  @return Search