Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UomList::findBySymbol() method #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hkdobrev
Copy link

This allows to find the common code given a popular symbol.
This is useful for user-generated unit codes like kg for example.

This allows to find the common code given a popular symbol.
This is useful for user-generated unit codes like kg for example.
@Xerkus
Copy link
Contributor

Xerkus commented Mar 25, 2016

There are multiple codes with same symbol, you should return array.

Iterating over the whole list might be expensive if done often, consider building index of [$symbol] = [$commoncode, $commoncode, ...]

*/
public function findBySymbol($symbol)
{
$symbol = trim($symbol);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameter must be sanitized outside of the function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants