Skip to content

Commit

Permalink
Merge pull request #2 from tophitter/feature/aes_encryption
Browse files Browse the repository at this point in the history
Feature/aes encryption
  • Loading branch information
tophitter authored Oct 9, 2023
2 parents 81c9391 + cfe6496 commit c1b6e16
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Database Helper",
"minimum-stability": "stable",
"license": "MIT",
"version": "1.0.11",
"version": "1.0.12",
"authors": [
{
"name": "jason",
Expand Down
10 changes: 10 additions & 0 deletions src/Database/Builder/SQL_FUNCTION.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class SQL_FUNCTION extends Enum{
const DATE_NOW = "NOW";
const CURDATE = "CURDATE";

const AES_DECRYPT = 'AES_DECRYPT';
const AES_ENCRYPT = 'AES_ENCRYPT';


/** @return string */
public static function getDATE_FORMAT() { return 'DATE_FORMAT({FIELD},{ARG})'; }
Expand All @@ -44,4 +47,11 @@ public static function getUNIX_TIMESTAMP() { return 'UNIX_TIMESTAMP({FIELD})'; }
public static function getDATE_NOW() { return 'now()'; }
public static function getCURDATE() { return 'CURDATE()'; }
public static function getSQL_IF() { return 'if({ARG})'; }

/** @return string */
public static function getAES_DECRYPT() : string { return 'AES_DECRYPT({FIELD},\'{ARG}\')'; }

/** @return string */
public static function getAES_ENCRYPT() : string { return 'AES_ENCRYPT({FIELD},\'{ARG}\')'; }

}
2 changes: 1 addition & 1 deletion src/Enums/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __toString() { return $this->getName(); }
* @throws LogicException Enums are not cloneable
* because instances are implemented as singletons
*/
private function __clone() { throw new LogicException('Enums are not cloneable'); }
public function __clone() { throw new LogicException('Enums are not cloneable'); }

/**
* @throws LogicException Enums are not serializable
Expand Down

0 comments on commit c1b6e16

Please sign in to comment.