Answers for "override belongto parent appmodel cakephp"

PHP
1

override belongto parent appmodel cakephp

// -------------------------------------------------------------
// ------------ Override belongto parent appmodel --------------
// -------------------------------------------------------------
public function __construct($id = false, $table = null, $ds = null) {
    $parent = get_parent_class($this);
    $this->_mergeVars(array('belongsTo'), $parent);	// override belongto parent appmodel

    parent::__construct($id, $table, $ds);
}
Posted by: Guest on October-02-2020
1

join cakphp

'joins' => array(
        array(
            'table' => Environment::read('table_prefix') . 'image_type_languages', 
            'alias' => 'language',
            'type' => 'INNER',
            'conditions'=> array(
                'ImageType.id = language.image_type_id',
                'language.alias = \'' . $language . '\'',
            )
        ),
    ),
Posted by: Guest on October-02-2020

Browse Popular Code Answers by Language