Start to implement advanced search query language

This commit is contained in:
Frederic Guillot
2015-06-28 18:52:01 -04:00
parent 0fa64fc9bd
commit e22985df50
9 changed files with 781 additions and 3 deletions

View File

@@ -99,6 +99,29 @@ class Color extends Base
),
);
/**
* Find a color id from the name or the id
*
* @access public
* @param string $color
* @return string
*/
public function find($color)
{
$color = strtolower($color);
foreach ($this->default_colors as $color_id => $params) {
if ($color_id === $color) {
return $color_id;
}
else if ($color === strtolower($params['name'])) {
return $color_id;
}
}
return '';
}
/**
* Get available colors
*