code: protected function generateIV()
      {
          $sizeIV = $this->getSizeIV();
  
          if ($sizeIV === 0) {
              return $this;
          }
  
          $this->setIV(mcrypt_create_iv($sizeIV, MCRYPT_RAND));
  
          return $this;
      }
docs: Generate random IV & set it as property
  
  @return self