/**
  * Sets our option value and encodes it if required.
  *
  * @param  mixed  $value
  * @return mixed
  */
 public function setOptionValueAttribute($value)
 {
     if (is_array($value)) {
         $value = json_encode($value);
     }
     $this->attributes['option_value'] = binary_sql($value);
 }
Beispiel #2
0
 /**
  * Sets our option value and encodes it if required.
  *
  * @param  mixed  $value
  * @return mixed
  */
 public function setOptionValueAttribute($value)
 {
     $this->attributes['option_value'] = binary_sql($value);
 }
Beispiel #3
0
 /**
  * Returns a SHA1 hash (in text or binary) representing an originality/r9k checksum.
  *
  * @static
  * @param  string  $body    The body to be checksum'd.
  * @param  bool    $binary  Optional. If the return should be binary. Defaults false.
  * @return string|binary
  */
 public static function makeChecksum($text, $binary = false)
 {
     $postRobot = preg_replace('/\\s+/', "", $text);
     $checksum = sha1($postRobot, $binary);
     if ($binary) {
         return binary_sql($checksum);
     }
     return $checksum;
 }
 /**
  * Sets our option value and encodes it if required.
  *
  * @param  mixed  $value
  * @return mixed
  */
 public function setChecksumAttribute($value)
 {
     if (!is_binary($value)) {
         $value = hex2bin($value);
     }
     $this->attributes['checksum'] = binary_sql($value);
 }
Beispiel #5
0
 /**
  * Sets our binary value and encodes it if required.
  *
  * @param  mixed  $value
  * @return mixed
  */
 public function setActionDetailsAttribute($value)
 {
     $this->attributes['action_details'] = binary_sql($value);
 }
Beispiel #6
0
 public function toSQL($start = true)
 {
     $ip = $start ? $this->getStart() : $this->getEnd();
     return binary_sql(inet_pton($ip));
 }