Letractively / add-mvc-framework

Automatically exported from code.google.com/p/add-mvc-framework
0 stars 0 forks source link

Custom non-row attribute #114

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Enable custom attributes from database that are not writeable

e.g. a field from a joined table

Possible Procedure:
When setting a non-row attribute, just declare a new property.

e.g.
{{{
CLASS company EXTENDS model_rwd {
   CONST TABLE = 'companies';
   public $owner_username;
}
}}}

Original issue reported on code.google.com by albertdi...@gmail.com on 26 Aug 2013 at 5:19

GoogleCodeExporter commented 9 years ago
Invalid unscanned_url variable id

this attempt fails:

   /**
    * __construct($array)
    * Fills $this->data with the $array contents
    * @param array $array
    * @since ADD MVC 0.0
    */
   protected function __construct($array) {
      if (isset($array)) {
         foreach ($array as $index=>$value) {
            if (is_array($value)) {
               # Check for recursive arrays, this idea of print_r isn't good
               if (
                     count($value) === count($array)
                     &&
                     print_r($value,true) === print_r($array,true)
                  ) {
                  continue;
               }
               else {
                  # Fix for https://code.google.com/p/add-mvc-framework/issues/detail?id=83
                  # https://code.google.com/p/add-mvc-framework/issues/detail?id=114
                  $this->$index = new self($value);
               }

            }
            else {
               # https://code.google.com/p/add-mvc-framework/issues/detail?id=114
               $this->$index = $value;
            }
         }
      }
   }

Original comment by albertdi...@gmail.com on 26 Aug 2013 at 5:25

GoogleCodeExporter commented 9 years ago
Maybe we shouldn't edit anything and let it be, there's probably no error in 
the first place

Original comment by albertdi...@gmail.com on 26 Aug 2013 at 5:28

GoogleCodeExporter commented 9 years ago
seems I already forgot what exactly this is about. Need to be reviewed

Original comment by albertdi...@gmail.com on 31 Jan 2014 at 3:55