summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Lela <eng.khaled.lela@gmail.com>2022-02-11 16:40:35 +0200
committerKhaled Lela <eng.khaled.lela@gmail.com>2022-02-11 16:40:35 +0200
commitad4a8ecc7e5613418a5dfddf83fe392492a69559 (patch)
tree7b4e939b0864fcd77727c2426ee4fb7601b28ab4
parentf2faa8f007834444a129db4fb8f4ece901b21fed (diff)
add doc for laravel builder dynamic where handler
-rw-r--r--src/Manager/ScormManager.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Manager/ScormManager.php b/src/Manager/ScormManager.php
index 56c723c..935bb2d 100644
--- a/src/Manager/ScormManager.php
+++ b/src/Manager/ScormManager.php
@@ -60,6 +60,31 @@ class ScormManager
throw new InvalidScormArchiveException('invalid_scorm_data');
}
+ /**
+ * ScormModel::whereOriginFile Query Builder style equals ScormModel::where('origin_file',$value)
+ *
+ * From Laravel doc https://laravel.com/docs/5.0/queries#advanced-wheres.
+ * Dynamic Where Clauses
+ * You may even use "dynamic" where statements to fluently build where statements using magic methods:
+ *
+ * Examples:
+ *
+ * $admin = DB::table('users')->whereId(1)->first();
+ *
+ * $john = DB::table('users')
+ * ->whereIdAndEmail(2, 'john@doe.com')
+ * ->first();
+ *
+ * $jane = DB::table('users')
+ * ->whereNameOrAge('Jane', 22)
+ * ->first();
+ *
+ *
+ * From laravel framework https://github.com/laravel/framework/blob/9.x/src/Illuminate/Database/Query/Builder.php'
+ *
+ * Handle dynamic method calls into the method.
+ * return $this->dynamicWhere($method, $parameters);
+ **/
$scorm = ScormModel::whereOriginFile($scormData['identifier']);
// Check if scom package already exists to drop old one.
if (!$scorm->exists()) {