public function getProject($nb_project)
    {
        $retval = false;

        if (is_object($nb_project) && !($nb_project instanceof CNabuDataObject)) {
            throw new ENabuCoreException(
                ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE,
                array('$nb_project', get_class($nb_project))
            );
        }

        if ($nb_project !== null) {
            $nb_project_id = nb_getMixedValue($nb_project, NABU_PROJECT_FIELD_ID);
            if (is_numeric($nb_project_id) || nb_isValidGUID($nb_project_id)) {
                $retval = $this->nb_project_list->getItem($nb_project_id);
            } elseif ($nb_project_id !== null && $nb_project_id !== false) {
                throw new ENabuCoreException(
                    ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE,
                    array('$nb_project', print_r($nb_project, true))
                );
            }
        }

        return $retval;
    }
public function getProject($nb_project)
    {
        $retval = false;

        if (is_object($nb_project) && !($nb_project instanceof CNabuDataObject)) {
            throw new ENabuCoreException(
                ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE,
                array('$nb_project', get_class($nb_project))
            );
        }

        if ($nb_project !== null) {
            $nb_project_id = nb_getMixedValue($nb_project, NABU_PROJECT_FIELD_ID);
            if (is_numeric($nb_project_id) || nb_isValidGUID($nb_project_id)) {
                $retval = $this->nb_project_list->getItem($nb_project_id);
            } elseif ($nb_project_id !== null && $nb_project_id !== false) {
                throw new ENabuCoreException(
                    ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE,
                    array('$nb_project', print_r($nb_project, true))
                );
            }
        }

        return $retval;
    }
public function getProject ( $ nb_project ) { $ retval = false ; if ( is_object ( $ nb_project ) && ! ( $ nb_project instanceof CNabuDataObject ) ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_UNEXPECTED_PARAM_CLASS_TYPE , array ( '$nb_project' , get_class ( $ nb_project ) ) ) ; } if ( $ nb_project !== null ) { $ nb_project_id = nb_getMixedValue ( $ nb_project , NABU_PROJECT_FIELD_ID ) ; if ( is_numeric ( $ nb_project_id ) || nb_isValidGUID ( $ nb_project_id ) ) { $ retval = $ this -> nb_project_list -> getItem ( $ nb_project_id ) ; } elseif ( $ nb_project_id !== null && $ nb_project_id !== false ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_UNEXPECTED_PARAM_VALUE , array ( '$nb_project' , print_r ( $ nb_project , true ) ) ) ; } } return $ retval ; }
Gets a Project by their ID.
If the internal Project List contains a instance with same ID returns this instance, else if not exists,
tries to locate it in the storage and, if exits, the load it, add into Project List and returns their
instance as result.
@param mixed $nb_project A CNabuDataObject instance containing a nb_project_id field or an ID.
@return CNabuProject Returns the Project instance if exists or false if not.
@throws ENabuCoreException Raises an exception if $nb_project has no valid value.
Gets a Project by their ID . If the internal Project List contains a instance with same ID returns this instance else if not exists tries to locate it in the storage and if exits the load it add into Project List and returns their instance as result .