daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public function getColors()
  2.     {
  3.         $db = Zend_Db_Table_Abstract::getDefaultAdapter();
  4.         $select = $db->select()
  5.                      ->from('color')
  6.                      ->join('productColor', 'prco_co_id = co_id')
  7.                      ->where('prco_pr_id = ?', $this->pr_id);
  8.  
  9.         $result = $db->fetchAll($select);
  10.         $colors = array();
  11.         array_walk($result, function($color, $key) use (&$colors) {
  12.             $colors[$color['co_code']] = $color;
  13.             preg_match_all('#([a-z_]+):([a-z]+)#i', $color['co_lang'], $matches);
  14.             $colors[$color['co_code']]['co_lang'] = array_combine($matches[1], $matches[2]);
  15.         });
  16.  
  17.         Zend_Debug::dump($colors);
  18.         return $colors;
  19.     }
RAW Paste Data
Top