File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " interaapps/uloleorm" ,
3- "version" : " 3.1.1 " ,
3+ "version" : " 3.1.2 " ,
44 "type" : " library" ,
55 "authors" : [
66 {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public function save(string $database = 'main'): bool {
2525 if (isset ($ this ->{$ fieldName }))
2626 $ query ->set ($ modelInformation ->getFieldName (), $ this ->{$ fieldName });
2727 }
28- return $ query ->where (UloleORM::getModelInformation (static ::class)->getIdentifier (), UloleORM::getModelInformation (static ::class)->getIdentifierValue ())->update () !== false ;
28+ return $ query ->where (UloleORM::getModelInformation (static ::class)->getIdentifier (), UloleORM::getModelInformation (static ::class)->getIdentifierValue ($ this ))->update () !== false ;
2929 } else {
3030 return $ this ->insert ($ database );
3131 }
Original file line number Diff line number Diff line change @@ -68,10 +68,18 @@ public static function getTableName($modelClazz): string {
6868 return self ::$ modelInformation [$ modelClazz ]->getName ();
6969 }
7070
71+ /**
72+ * @param $model
73+ * @return ModelInformation
74+ * @throws Null
75+ */
7176 public static function getModelInformation ($ model ): ModelInformation {
77+ if (!isset (self ::$ modelInformation [$ model ]))
78+ throw new \Exception ("Register the model first with UloleORM::register( " .$ model ."::class); " );
7279 return self ::$ modelInformation [$ model ];
7380 }
7481
82+
7583 public static function getAttributesEnabled (): bool {
7684 return self ::$ attributesEnabled ;
7785 }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class Column {
88 private bool $ ai = false ;
99 private bool $ unique = false ;
1010 private bool $ primary = false ;
11- private string | int | null $ size ; // Can also be value
11+ private mixed $ size ; // Can also be value
1212 private mixed $ default ;
1313 private bool $ nullable = true ;
1414 private string |null $ renameTo = null ;
Original file line number Diff line number Diff line change 11{
22 "name" : " uloleorm" ,
3- "version" : " 3.1.1 " ,
3+ "version" : " 3.1.2 " ,
44 "repositories" : [],
55 "run" : {},
66 "build" : {},
You can’t perform that action at this time.
0 commit comments