3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @author Brian Sandes * brian.sandes@gmail.com * Post class * Servus! Open-Source Development Framework */ class Product extends AppModel { public $Table = "{__PREF__}products"; public $Fields = Array( "id" => Array("extra" => "auto_increment"), "product_category_id" => Array("required" => true), "product_subcategory_id" => Array("required" => true), "line_id" => Array("required" => true), "name" => Array("type" => "text", "required" => true), "description" => Array("type" => "text"), "code" => Array("type" => "text"), "model" => Array("type" => "text"), "details" => Array("type" => "text", "class" => "simple-tinymce"), "blueprint" => Array("type" => "file"), "guide" => Array("type" => "file"), "dwg" => Array("type" => "file"), "video" => Array("type" => "text"), "bndes" => Array("type" => "checkbox"), "ambient" => Array(), "display_order" => Array("type" => "text"), "date" => Array("function" => "return date('Y-m-d H:i:s');", "display" => "return toDate('\$1', 'd/m/Y H:i:s');"), "last_update" => Array("display" => "return toDate('\$1', 'd/m/Y H:i:s');"), "status" => Array("type" => "radio") ); public static $Conf = Array( "mode" => "LAED", "grid" => Array("id", "name", "code", "category", "subcategory", "product_line", "last_update"), "icon" => "icon-shopping-cart" ); public function AltQuery($where = null, $plus = null) { $ProductCategory = new ProductCategory(); $ProductLine = new ProductLine(); $ProductImage = new ProductImage(); $Href = new Href(); return "SELECT {$this->Table}.*, c1.name as category, c2.name as subcategory, {$ProductLine->Table}.name as product_line, {$ProductImage->Table}.name as listing_image, {$Href->Table}.ref as ref FROM {$this->Table} LEFT OUTER JOIN {$ProductCategory->Table} c1 ON {$this->Table}.product_category_id = c1.id LEFT OUTER JOIN {$ProductCategory->Table} c2 ON {$this->Table}.product_subcategory_id = c2.id LEFT OUTER JOIN {$ProductLine->Table} ON {$this->Table}.line_id = {$ProductLine->Table}.id LEFT OUTER JOIN {$ProductImage->Table} ON {$ProductImage->Table}.product_id = {$this->Table}.id AND {$ProductImage->Table}.type = 'listing' LEFT OUTER JOIN {$Href->Table} ON {$Href->Table}.content_id = {$this->Table}.id and {$Href->Table}.type = 'product' $where GROUP BY {$this->Table}.id $plus"; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WQeWn
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'product', 'appmodel'
   65     1      > RETURN                                                   1

Class Product:
Function altquery:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WQeWn
function name:  AltQuery
number of ops:  83
compiled vars:  !0 = $where, !1 = $plus, !2 = $ProductCategory, !3 = $ProductLine, !4 = $ProductImage, !5 = $Href
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
   40     2        NEW                                              $6      'ProductCategory'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $6
   41     5        NEW                                              $9      'ProductLine'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !3, $9
   42     8        NEW                                              $12     'ProductImage'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !4, $12
   43    11        NEW                                              $15     'Href'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !5, $15
   45    14        ROPE_INIT                                    46  ~40     'SELECT+'
         15        FETCH_OBJ_R                                      ~18     'Table'
         16        ROPE_ADD                                      1  ~40     ~40, ~18
         17        ROPE_ADD                                      2  ~40     ~40, '.%2A%2C%0A++++++++++++++++c1.name+as+category%2C%0A++++++++++++++++c2.name+as+subcategory%2C%0A++++++++++++++++'
   48    18        FETCH_OBJ_R                                      ~19     !3, 'Table'
         19        ROPE_ADD                                      3  ~40     ~40, ~19
         20        ROPE_ADD                                      4  ~40     ~40, '.name+as+product_line%2C%0A++++++++++++++++'
   49    21        FETCH_OBJ_R                                      ~20     !4, 'Table'
         22        ROPE_ADD                                      5  ~40     ~40, ~20
         23        ROPE_ADD                                      6  ~40     ~40, '.name+as+listing_image%2C%0A++++++++++++++++'
   50    24        FETCH_OBJ_R                                      ~21     !5, 'Table'
         25        ROPE_ADD                                      7  ~40     ~40, ~21
         26        ROPE_ADD                                      8  ~40     ~40, '.ref+as+ref%0A++++++++++++FROM+'
   51    27        FETCH_OBJ_R                                      ~22     'Table'
         28        ROPE_ADD                                      9  ~40     ~40, ~22
         29        ROPE_ADD                                     10  ~40     ~40, '%0A++++++++++++LEFT+OUTER+JOIN+'
   52    30        FETCH_OBJ_R                                      ~23     !2, 'Table'
         31        ROPE_ADD                                     11  ~40     ~40, ~23
         32        ROPE_ADD                                     12  ~40     ~40, '+c1%0A++++++++++++++++ON+'
   53    33        FETCH_OBJ_R                                      ~24     'Table'
         34        ROPE_ADD                                     13  ~40     ~40, ~24
         35        ROPE_ADD                                     14  ~40     ~40, '.product_category_id+%3D+c1.id%0A++++++++++++LEFT+OUTER+JOIN+'
   54    36        FETCH_OBJ_R                                      ~25     !2, 'Table'
         37        ROPE_ADD                                     15  ~40     ~40, ~25
         38        ROPE_ADD                                     16  ~40     ~40, '+c2%0A++++++++++++++++ON+'
   55    39        FETCH_OBJ_R                                      ~26     'Table'
         40        ROPE_ADD                                     17  ~40     ~40, ~26
         41        ROPE_ADD                                     18  ~40     ~40, '.product_subcategory_id+%3D+c2.id%0A++++++++++++LEFT+OUTER+JOIN+'
   56    42        FETCH_OBJ_R                                      ~27     !3, 'Table'
         43        ROPE_ADD                                     19  ~40     ~40, ~27
         44        ROPE_ADD                                     20  ~40     ~40, '%0A++++++++++++++++ON+'
   57    45        FETCH_OBJ_R                                      ~28     'Table'
         46        ROPE_ADD                                     21  ~40     ~40, ~28
         47        ROPE_ADD                                     22  ~40     ~40, '.line_id+%3D+'
         48        FETCH_OBJ_R                                      ~29     !3, 'Table'
         49        ROPE_ADD                                     23  ~40     ~40, ~29
         50        ROPE_ADD                                     24  ~40     ~40, '.id%0A++++++++++++LEFT+OUTER+JOIN+'
   58    51        FETCH_OBJ_R                                      ~30     !4, 'Table'
         52        ROPE_ADD                                     25  ~40     ~40, ~30
         53        ROPE_ADD                                     26  ~40     ~40, '%0A++++++++++++++++ON+'
   59    54        FETCH_OBJ_R                                      ~31     !4, 'Table'
         55        ROPE_ADD                                     27  ~40     ~40, ~31
         56        ROPE_ADD                                     28  ~40     ~40, '.product_id+%3D+'
         57        FETCH_OBJ_R                                      ~32     'Table'
         58        ROPE_ADD                                     29  ~40     ~40, ~32
         59        ROPE_ADD                                     30  ~40     ~40, '.id+AND+'
         60        FETCH_OBJ_R                                      ~33     !4, 'Table'
         61        ROPE_ADD                                     31  ~40     ~40, ~33
         62        ROPE_ADD                                     32  ~40     ~40, '.type+%3D+%27listing%27%0A++++++++++++LEFT+OUTER+JOIN+'
   60    63        FETCH_OBJ_R                                      ~34     !5, 'Table'
         64        ROPE_ADD                                     33  ~40     ~40, ~34
         65        ROPE_ADD                                     34  ~40     ~40, '%0A++++++++++++++++ON+'
   61    66        FETCH_OBJ_R                                      ~35     !5, 'Table'
         67        ROPE_ADD                                     35  ~40     ~40, ~35
         68        ROPE_ADD                                     36  ~40     ~40, '.content_id+%3D+'
         69        FETCH_OBJ_R                                      ~36     'Table'
         70        ROPE_ADD                                     37  ~40     ~40, ~36
         71        ROPE_ADD                                     38  ~40     ~40, '.id+and+'
         72        FETCH_OBJ_R                                      ~37     !5, 'Table'
         73        ROPE_ADD                                     39  ~40     ~40, ~37
         74        ROPE_ADD                                     40  ~40     ~40, '.type+%3D+%27product%27%0A++++++++++++'
   62    75        ROPE_ADD                                     41  ~40     ~40, !0
         76        ROPE_ADD                                     42  ~40     ~40, '+GROUP+BY+'
         77        FETCH_OBJ_R                                      ~38     'Table'
         78        ROPE_ADD                                     43  ~40     ~40, ~38
         79        ROPE_ADD                                     44  ~40     ~40, '.id+'
         80        ROPE_END                                     45  ~39     ~40, !1
         81      > RETURN                                                   ~39
   63    82*     > RETURN                                                   null

End of function altquery

End of class Product.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.57 ms | 1403 KiB | 13 Q