mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
General improvements
This commit is contained in:
17
GrocyPhpHelper.php
Normal file
17
GrocyPhpHelper.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class GrocyPhpHelper
|
||||
{
|
||||
public static function FindObjectInArrayByPropertyValue($array, $propertyName, $propertyValue)
|
||||
{
|
||||
foreach($array as $object)
|
||||
{
|
||||
if($object->{$propertyName} == $propertyValue)
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user