public static function getIdFromHref($basename, $href) {
		$regex = ',https://.+/api/acct/[0-9]+/' . $basename . '/([0-9]+),';
		$matches = array();
		preg_match($regex, $href, $matches);

		return count($matches) > 0 ? $matches[1] : 0;
	}
public static function getIdFromHref($basename, $href) {
		$regex = ',https://.+/api/acct/[0-9]+/' . $basename . '/([0-9]+),';
		$matches = array();
		preg_match($regex, $href, $matches);

		return count($matches) > 0 ? $matches[1] : 0;
	}
public static function getIdFromHref ( $ basename , $ href ) { $ regex = ',https://.+/api/acct/[0-9]+/' . $ basename . '/([0-9]+),' ; $ matches = array ( ) ; preg_match ( $ regex , $ href , $ matches ) ; return count ( $ matches ) > 0 ? $ matches [ 1 ] : 0 ; }
Returns the object id when given the objects basename and it's href.

@static
@example RightScaleClient::getIdFromHref('credentials', 'https://my.rightscale.com/api/acct/12345/credentials/12345');
@param string $basename The name of the object as it appears in the URL.  I.E. For Credentials it is "credentials" since the URL looks like https://my.rightscale.com//api/acct/12345/credentials/12345
@param string $href The full API href of the object.  I.E. https://my.rightscale.com/api/acct/12345/credentials/12345

@return integer The ID of the object
Returns the object id when given the objects basename and it s href .