Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getColors()
- {
- $db = Zend_Db_Table_Abstract::getDefaultAdapter();
- $select = $db->select()
- ->from('color')
- ->join('productColor', 'prco_co_id = co_id')
- ->where('prco_pr_id = ?', $this->pr_id);
- $result = $db->fetchAll($select);
- $colors = array();
- array_walk($result, function($color, $key) use (&$colors) {
- $colors[$color['co_code']] = $color;
- preg_match_all('#([a-z_]+):([a-z]+)#i', $color['co_lang'], $matches);
- $colors[$color['co_code']]['co_lang'] = array_combine($matches[1], $matches[2]);
- });
- Zend_Debug::dump($colors);
- return $colors;
- }
Add Comment
Please, Sign In to add comment