Field Formula
Apply formula for fields before insert/update operation (added in version 2.5)
You can apply basic formula to change value of the field before insert/update operation dynamically. It can be done using
the callback function also but this function is added to provide more convenient way to do same. It also helps to set
the value to NULL for empty values to help to enter data in case of database restriction for e.g. saving NULL for datetime
for empty values.
$pdocrud = new PDOCrud();
// format field to 2 decimal point
$pdocrud->fieldFormula("tax", "formula",array("type" =>"round","decimalpoint"=>2));
// format field to 2 decimal point
$pdocrud->fieldFormula("product_discount", "formula",array("type" =>"number_format","decimalpoint"=>2));
// get ceil value of field
$pdocrud->fieldFormula("product_price", "formula",array("type" =>"ceil"));
//get floor value of field
$pdocrud->fieldFormula("product_sell_price", "formula",array("type" =>"floor"));
//string type - adding prefix of sku always and checking for duplicate i.e. string already have sku or not
$pdocrud->fieldFormula("product_id","string",array("type" =>"prefix","str"=>"SKU_","duplicate"=>true));
//make product name first letter upper case
$pdocrud->fieldFormula("product_name", "string",array("type" =>"uppercase"));
//setting value to NULL if empty
$pdocrud->fieldFormula("added_Date", "string",array("type" =>"null"));
echo $pdocrud->dbTable("products")->render();
This replica features working kickstand, front suspension, gear-shift lever, footbrake lever, drive chain, wheels and steering. All parts are particularly delicate due to their precise scale and require special care and attention.
Official Moto Guzzi logos and insignias, saddle bags located on side of motorcycle, detailed engine, working steering, working suspension, two leather seats, luggage rack, dual exhaust pipes, small saddle bag located on handle bars, two-tone paint with chrome accents, superior die-cast detail , rotating wheels , working kick stand, diecast metal with plastic parts and baked enamel finish.
Model features, official Harley Davidson logos and insignias, detachable rear wheelie bar, heavy diecast metal with resin parts, authentic multi-color tampo-printed graphics, separate engine drive belts, free-turning front fork, rotating tires and rear racing slick, certificate of authenticity, detailed engine, display stand
, precision diecast replica, baked enamel finish, 1:10 scale model, removable fender, seat and tank cover piece for displaying the superior detail of the v-twin engine
Official logos and insignias, saddle bags located on side of motorcycle, detailed engine, working steering, working suspension, two leather seats, luggage rack, dual exhaust pipes, small saddle bag located on handle bars, two-tone paint with chrome accents, superior die-cast detail , rotating wheels , working kick stand, diecast metal with plastic parts and baked enamel finish.