diff --git a/README.md b/README.md index b49389f..facc0a6 100644 --- a/README.md +++ b/README.md @@ -1686,7 +1686,7 @@ The nested operators are methods that should be in between of our chain of metho > ClassRepo::op()::where()::finalop() is ✅ > -> ClassRepo::op()::op()::where() will left the chain open ❌ +> ClassRepo::op()::op()::where() will leave the chain open ❌ For example: @@ -1862,7 +1862,8 @@ In a nutshell: > Every minor version means that it adds a new functionality i.e. 1.5 -> 1.6 (new methods) > > Every decimal version means that it patches/fixes/refactoring a previous functionality i.e. 1.5.0 -> 1.5.1 (fix) - +* 4.3.3 2023-09-05 + * change the PHPDOC comments, now it uses markdown instead of "pre" tag. * 4.3.2 2023-09-05 * A small fix with the error messages, now on level 1 it shows the cause of the error. * 4.3.1 2023-09-02 @@ -2079,7 +2080,7 @@ it as a PHP file. * * **_BasePdoOneRepo** now works more closely with the class **PdoOneQuery**, so each query is a different instance. - * **[fix]** **PdoOne** dateConvertInput() does not crashes when the value is not a date. + * **[fix]** **PdoOne** dateConvertInput() does not crash when the value is not a date. * **[fix]** **PdoOne** throwError() does not stack errors but still triggers the last error (if any). @@ -2267,7 +2268,7 @@ echo $this->internalCacheCounter; the type. It also allows many other different kind of combinations. * Before: **$this->runRawQuery($sql,['i',20,'s','hello]);** * Now: **$this->runRawQuery($sql,[20,'hello']);** - * Also (named): **$this->runRawQuery($sql,['col1'=>20,'col2'=>'hello']);** + * Also, (named): **$this->runRawQuery($sql,['col1'=>20,'col2'=>'hello']);** * Since it is a core change, then former code that uses the version 1.x could not be compatible without changing all references to methods that use arguments specifying the types. * runRawQuery() diff --git a/lib/PdoOne.php b/lib/PdoOne.php index 6907a59..275e750 100644 --- a/lib/PdoOne.php +++ b/lib/PdoOne.php @@ -336,10 +336,10 @@ public static function newColFK($key, $refcol, $reftable, $extra = null, $name = /** * We clean a sql that it could contain columns
* Example:
- *
+     * ```php
      * PdoOne::cleanColumns("col1,col2"); // col1,col2
      * PdoOne::cleanColumns("col1';,col2"); // col1;,col2
-     * 
+ * ``` * @param string $sql * @return array|string|string[] */ @@ -465,9 +465,9 @@ public static function dateTimeSql2PHP(string $sqlField, bool &$hasTime = false) /** * It converts a date (as string) into another format or false if it fails.
* Example: - *
+     * ```php
      * $pdoOne->dateConvert('01/01/2019','human','sql'); // 2019-01-01
-     * 
+ * ``` * iso it is the standard format used for transporting
* human It is based in d/m/Y H:i:s, but it could be changed (self::dateHumanFormat)
* sql it is the format used by the database
@@ -542,13 +542,13 @@ public static function dateConvert($sqlField, string $inputFormat, string $outpu * It converts a date and time value (expressed in different means) into a DateTime object or false if the operation * fails.
* Example:
- *
+     * ```php
      * $r=PdoOne::dateConvertInput('01/12/2020','human',$ms,$time); // it depends on the fields self::$date*HumanFormat
      * $r=PdoOne::dateConvertInput('2020-12-01','iso',$ms,$time); // it depends on the fields self::$date*Format
      * $r=PdoOne::dateConvertInput('2020-12-01','sql',$ms,$time); // it depends on the database
      * $r=PdoOne::dateConvertInput(50000,'timestamp',$ms,$time); // a timestamp
      * $r=PdoOne::dateConvertInput(new DateTime(),'class',$ms,$time); // a DateTime object (it keeps the same one)
-     * 
+ * ``` * * @param mixed $inputValue the input value. * @param string $inputFormat =['iso','human','sql','class','timestamp'][$i] The input format @@ -829,12 +829,12 @@ public static function tableCase(?string $txt) * It converts a name to singular. This method is used automatically for the generation of the repository * classes
* Example:
- *
+     * ```php
      * self::singularTable('categories'); // category
      * self::singularTable('churches'); // church
      * self::singularTable('prices'); // pric (it fail with this kind of cases)
      * self::singularTable('users'); // user
-     * 
+ * ``` * @param $tableName * @return false|mixed|string */ @@ -940,11 +940,11 @@ public function validateDefTable(string $table, array $defArray, $defKeys, array *
  • sql: the sql syntax of the column
  • * * Example:
    - *
    +     * ```php
          * $this->getDefTable('tablename',$conversion);
          * // ['col1'=>['alias'=>'','phptype'=>'int','conversion'=>null,'type'=>'int','size'=>null
          * // ,'null'=>false,'identity'=>true,'sql'='int not null auto_increment'
    -     * 
    + * ``` * * @param string $table The name of the table * @param array|null $specialConversion An associative array to set special conversion of values with the key as the @@ -999,10 +999,10 @@ public function getDefTable(string $table, ?array $specialConversion = null): ar /** * It converts a sql type into a 'php type' and a pdo::param type
    * Example:
    - *
    +     * ```php
          * $this->dbTypeToPHP('varchar'); // ['string',PDO::PARAM_STR]
          * $this->dbTypeToPHP('int'); // ['int',PDO::PARAM_INT]
    -     * 
    + * ``` * PHP Types: binary, date, datetime, decimal,int, string,time, timestamp
    * Param Types: PDO::PARAM_LOB, PDO::PARAM_STR, PDO::PARAM_INT
    * @@ -1092,10 +1092,10 @@ public function dbTypeToPHP(string $type): array * is_primary_key: Is 1 if the value is a primary key, otherwise 0
    * TYPE: returns PRIMARY KEY, UNIQUE KEY or KEY depending on the type of the key
    * Example:
    - *
    +     * ```php
          * $this->getDefTableKeys('table1');
          * // ["IndexName"=>'',"ColumnName"=>'',"is_unique"=>0,"is_primary_key"=>0,"TYPE"=>'']
    -     * 
    + * ``` * * @param string $table The name of the table to analize. * @param bool $returnSimple true= returns as a simple associative @@ -1139,11 +1139,11 @@ public function getDefTableFK(string $table, bool $returnSimple = true, bool $as * The results of the table depend on the kind of database. For example, sqlsrv returns the schema used (dbo), * while mysql returns the current schema (database). * Example:
    - *
    +     * ```php
          * $this->getDefTableExtended('table'); // ['name','engine','schema','collation','description']
          * $this->getDefTableExtended('table',true); // "some description of the table"
          *
    -     * 

    + * ```
    * Fields returned:
    *