This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
lnapp/classes/Object.php
2013-10-03 16:51:13 +10:00

33 lines
772 B
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This is class is for manupulating objects in general
*
* @package lnApp
* @category Helpers
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Object {
/**
* Provide an in_array capability for an array of Objects
*
* @param string Object Key that we are evaluating
* @param string Value for that Key
* @param array The array of objects
* @return boolean
*/
public static function in_array($key,$value,array $objects) {
if (! count($objects))
return FALSE;
foreach ($objects as $object)
if (isset($object->$key) AND $object->$key == $value)
return TRUE;
return FALSE;
}
}
?>