Skip to content
Niklas Spanring edited this page Oct 17, 2016 · 1 revision

Table of Contents

infoBlock

The infoBlock Class initializes the info part of a CAP

The container for all component parts of the info sub-element of the alert message (OPTIONAL)

  $info->language = "en-US"; // language-COUNTRY Format RFC 3066 Specification: de-DE -> German
  $info->category = array(); // Geo / Met / Safety / Security / Rescue / Fire / Health / Env / Transport / Infra / CBRNE / Other
  $info->event; // The text denoting the type of the subject event of the alert message
  $info->responseType = array(); // Shelter / Evacuate / Prepare / Execute / Avoid / Monitor / Assess / AllClear / None
  $info->urgency; // Immediate / Expected / Future / Past
  $info->severity; // Extreme / Severe / Moderate / Minor / Unknown
  $info->certainty; // Observed / Likely / Possible/ Unlikely / Unknown
  $info->audience; // The text describing the intended audience of the alert message 
  $info->eventCode = array(); // <eventCode>  <valueName>valueName</valuename>  <value>value</value></eventcode>
  $info->effective; // The effective time(oid)                                                      / Form: <yyyy>-<MM>-T<HH>:<mm>:<ss>+<hour>:<min> Offset to UTC 
  $info->onset; // The expected time of the beginning of the subject event of the alert message / Form: <yyyy>-<MM>-T<HH>:<mm>:<ss>+<hour>:<min> Offset to UTC -> 2015-01-08T10:05:02+01:00
  $info->expires; // The expiry time of the information of the alert message                      / Form: <yyyy>-<MM>-T<HH>:<mm>:<ss>+<hour>:<min> Offset to UTC -> 2015-01-08T15:00:13+01:00
  $info->senderName; // The text naming the originator of the alert message  (The human-readable name of the agency or authority issuing this alert.) -> ZAMG Österreich
  $info->headline; // The text headline of the alert message 
  $info->description; // The text describing the subject event of the alert message 
  $info->instruction; // The text describing the recommended action to be taken by recipients of the alert message 
  $info->web; // The identifier of the hyperlink associating additional information with the alert message 
  $info->contact; // The text describing the contact for follow-up and confirmation of the alert message 
  $info->parameter = array(); // A system-specific additional parameter associated with the alert message (as example meteoalarm.eu using it as specific warnings identifier) <parameter>  <valueName>valueName</valuename>  <value>value</value></parameter>
  $info->resource = array();
  $info->area = array();
        
  $info = $alert->addInfo();

getLanguage()

returns the Language

The code denoting the language of the info sub-element of the alert message (OPTIONAL)
(1)   Code Values: Natural language identifier per [RFC 3066].
(2)   If not present, an implicit default value of "en-US" SHALL be assumed. 
(3)   A null value in this element SHALL be considered equivalent to “en-US.”
  $alert->getLanguage();

setLanguage($val)

sets the value of the Language

The code denoting the language of the info sub-element of the alert message (OPTIONAL)
(1)   Code Values: Natural language identifier per [RFC 3066].
(2)   If not present, an implicit default value of "en-US" SHALL be assumed. 
(3)   A null value in this element SHALL be considered equivalent to “en-US.”
  $alert->setLanguage('LANG_RFC_3066');

getCategory()

returns the Category

  The code denoting the category of the subject event of the alert message (REQUIRED)
  Geo - Geophysical (inc. landslide)
  Met - Meteorological (inc. flood)
  Safety - General emergency and public safety
  Security - Law enforcement, military, homeland and local/private security
  Rescue - Rescue and recovery
  Fire - Fire suppression and rescue
  Health - Medical and public health
  Env - Pollution and other environmental
  Transport - Public and private transportation
  Infra - Utility, telecommunication, other non-transport infrastructure
  CBRNE – Chemical, Biological, Radiological, Nuclear or High-Yield Explosive threat or attack
  Other - Other events
(2)   Multiple instances MAY occur within an <info> block.
  $alert->getCategory();

setCategory($val)

sets the value of the status

This method will return false if not one of thes values is used:

  The code denoting the category of the subject event of the alert message (REQUIRED)
  Geo - Geophysical (inc. landslide)
  Met - Meteorological (inc. flood)
  Safety - General emergency and public safety
  Security - Law enforcement, military, homeland and local/private security
  Rescue - Rescue and recovery
  Fire - Fire suppression and rescue
  Health - Medical and public health
  Env - Pollution and other environmental
  Transport - Public and private transportation
  Infra - Utility, telecommunication, other non-transport infrastructure
  CBRNE – Chemical, Biological, Radiological, Nuclear or High-Yield Explosive threat or attack
  Other - Other events
(2)   Multiple instances MAY occur within an <info> block.
  $alert->setCategory('POS_VALUE');

getEvent()

returns the Event

The text denoting the type of the subject event of the alert message (REQUIRED)
  $alert->getEvent();

setEvent($val)

sets the value of the Event

The text denoting the type of the subject event of the alert message (REQUIRED)
  $alert->setEvent('EVENT');

getResponseType()

returns the ResponseType

The code denoting the type of action recommended for the target audience (OPTIONAL)
(2) Multiple instances MAY occur within an <info> block.
  Shelter – Take shelter in place or per <instruction>
  Evacuate – Relocate as instructed in the <instruction>
  Prepare – Make preparations per the <instruction>
  Execute – Execute a pre-planned activity identified in <instruction>
  Avoid – Avoid the subject event as per the <instruction>
  Monitor – Attend to information sources as described in <instruction>
  Assess – Evaluate the information in this message.  (This value SHOULD NOT be used in public warning applications.)
  AllClear – The subject event no longer poses a threat or concern and any follow on action is described in <instruction>
  None – No action recommended
  $alert->getResponseType();

setResponseType($val)

sets the value of the ResponseType

The code denoting the type of action recommended for the target audience (OPTIONAL)
(2) Multiple instances MAY occur within an <info> block.
This method will return false if not one of thes values is used:
  Shelter – Take shelter in place or per <instruction>
  Evacuate – Relocate as instructed in the <instruction>
  Prepare – Make preparations per the <instruction>
  Execute – Execute a pre-planned activity identified in <instruction>
  Avoid – Avoid the subject event as per the <instruction>
  Monitor – Attend to information sources as described in <instruction>
  Assess – Evaluate the information in this message.  (This value SHOULD NOT be used in public warning applications.)
  AllClear – The subject event no longer poses a threat or concern and any follow on action is described in <instruction>
  None – No action recommended
  $alert->ResponseType('POS_VALUE');

getUrgency()

returns the Urgency

The code denoting the urgency of the subject event of the alert message (REQUIRED)
(1) The <urgency>, <severity>, and <certainty> elements collectively distinguish less emphatic from more emphatic messages.
  Immediate - Responsive action SHOULD be taken immediately
  Expected - Responsive action SHOULD be taken soon (within next hour)
  Future - Responsive action SHOULD be taken in the near future
  Past - Responsive action is no longer required
  Unknown - Urgency not known
  $alert->getUrgency();

setUrgency($val)

sets the value of the Urgency

The code denoting the urgency of the subject event of the alert message (REQUIRED)
(1) The <urgency>, <severity>, and <certainty> elements collectively distinguish less emphatic from more emphatic messages.
This method will return false if not one of thes values is used:
  Immediate - Responsive action SHOULD be taken immediately
  Expected - Responsive action SHOULD be taken soon (within next hour)
  Future - Responsive action SHOULD be taken in the near future
  Past - Responsive action is no longer required
  Unknown - Urgency not known
  $alert->setUrgency('POS_VALUE');

getSeverity()

returns the Severity

The code denoting the severity of the subject event of the alert message (REQUIRED)
(1) The <urgency>, <severity>, and <certainty> elements collectively distinguish less emphatic from more emphatic messages.
  Extreme - Extraordinary threat to life or property
  Severe - Significant threat to life or property
  Moderate - Possible threat to life or property
  Minor – Minimal to no known threat to life or property
  Unknown - Severity unknown
  $alert->getSeverity();

setSeverity($val)

sets the value of the Severity

The code denoting the severity of the subject event of the alert message (REQUIRED)
(1) The <urgency>, <severity>, and <certainty> elements collectively distinguish less emphatic from more emphatic messages.
This method will return false if not one of thes values is used:
  Immediate - Responsive action SHOULD be taken immediately
  Expected - Responsive action SHOULD be taken soon (within next hour)
  Future - Responsive action SHOULD be taken in the near future
  Past - Responsive action is no longer required
  Unknown - Urgency not known
  $alert->setSeverity('POS_VALUE');

getCertainty()

returns the Certainty

The code denoting the certainty of the subject event of the alert message (REQUIRED)
(1) The <urgency>, <severity>, and <certainty> elements collectively distinguish less emphatic from more emphatic messages.
  Extreme - Extraordinary threat to life or property
  Severe - Significant threat to life or property
  Moderate - Possible threat to life or property
  Minor – Minimal to no known threat to life or property
  Unknown - Severity unknown
  $alert->getCertainty();

setCertainty($val)

sets the value of the Certainty

The code denoting the certainty of the subject event of the alert message (REQUIRED)
(1) The <urgency>, <severity>, and <certainty> elements collectively distinguish less emphatic from more emphatic messages.
This method will return false if not one of thes values is used:
  Extreme - Extraordinary threat to life or property
  Severe - Significant threat to life or property
  Moderate - Possible threat to life or property
  Minor – Minimal to no known threat to life or property
  Unknown - Severity unknown
  $alert->setCertainty('POS_VALUE');

getAudience()

returns the Audience

The text describing the intended audience of the alert message (OPTIONAL)
  $alert->getAudience();

setAudience($val)

sets the value of the Audience

The text describing the intended audience of the alert message (OPTIONAL)
  $alert->setAudience('AUDIENCE');

getEventCode()

returns the EventCode Array

A system-specific code identifying the event type of the alert message (OPTIONAL)
(1) Any system-specific code for event typing, in the form:
<eventCode>
  <valueName>valueName</valuename>
  <value>value</value>
</eventcode>
where the content of “valueName” is a user-assigned string designating the domain of the code, and the content of “value” is a string (which may represent a number) denoting the value itself (e.g., valueName ="SAME" and value="CEM").
(2) Values of “valueName” that are acronyms SHOULD be represented in all capital letters without periods (e.g., SAME, FIPS, ZIP).
(3)  Multiple instances MAY occur within an <info> block.
  $alert->getEventCode();

setEventCode($valn, $val, $index = false)

sets the value of the EventCode

A system-specific code identifying the event type of the alert message (OPTIONAL)
(1) Any system-specific code for event typing, in the form:
<eventCode>
  <valueName>valueName</valuename>
  <value>value</value>
</eventcode>
where the content of “valueName” is a user-assigned string designating the domain of the code, and the content of “value” is a string (which may represent a number) denoting the value itself (e.g., valueName ="SAME" and value="CEM").
(2) Values of “valueName” that are acronyms SHOULD be represented in all capital letters without periods (e.g., SAME, FIPS, ZIP).
(3)  Multiple instances MAY occur within an <info> block.
  $alert->setEventCode('EVENT_NAME', 'EVENT_VALUE', INDEX_NUM);

getEffective()

returns the Effective

The effective time of the information of the alert message (OPTIONAL)
(1) The date and time SHALL be represented in the DateTime Data Type (See Implementation Notes) format (e.g., “2002-05-24T16:49:00-07:00” for 24 May 2002 at 16: 49 PDT).
(2) Alphabetic timezone designators such as “Z” MUST NOT be used.  The timezone for UTC MUST be represented as “-00:00”.
(3) If this item is not included, the effective time SHALL be assumed to be the same as in <sent>.
  $alert->getEffective();

setEffective($val)

sets the value of the Effective

This method uses strtotime() to convert a given time string to the CAP DateTime

posible values:

  2002-05-24T16:49:00-07:00
  24 May 2002 at 16:49 PDT
  now + 1 day + 1 hour + 1 min + 1 sec
The effective time of the information of the alert message (OPTIONAL)
(1) The date and time SHALL be represented in the DateTime Data Type (See Implementation Notes) format (e.g., “2002-05-24T16:49:00-07:00” for 24 May 2002 at 16: 49 PDT).
(2) Alphabetic timezone designators such as “Z” MUST NOT be used.  The timezone for UTC MUST be represented as “-00:00”.
(3) If this item is not included, the effective time SHALL be assumed to be the same as in <sent>.
  $alert->setEffective('2002-05-24T16:49:00-07:00');

getOnset()

returns the Onset

The expected time of the beginning of the subject event of the alert message (OPTIONAL)
(1) The date and time SHALL be represented in the DateTime Data Type (See Implementation Notes) format (e.g., “2002-05-24T16:49:00-07:00” for 24 May 2002 at 16: 49 PDT).
(2) Alphabetic timezone designators such as “Z” MUST NOT be used.  The timezone for UTC MUST be represented as “-00:00”.
  $alert->getOnset();

setOnset($val)

sets the value of the Onset

This method uses strtotime() to convert a given time string to the CAP DateTime

posible values:



The expected time of the beginning of the subject event of the alert message (OPTIONAL)
(1) The date and time SHALL be represented in the DateTime Data Type (See Implementation Notes) format (e.g., “2002-05-24T16:49:00-07:00” for 24 May 2002 at 16: 49 PDT).
(2) Alphabetic timezone designators such as “Z” MUST NOT be used.  The timezone for UTC MUST be represented as “-00:00”.
  $alert->setOnset('2002-05-24T16:49:00-07:00');

getExpires()

returns the Onset

The expiry time of the information of the alert message (OPTIONAL)
(1) The date and time SHALL be represented in the DateTime Data Type (See Implementation Notes) format (e.g., “2002-05-24T16:49:00-07:00” for 24 May 2002 at 16:49 PDT).
(2) Alphabetic timezone designators such as “Z” MUST NOT be used.  The timezone for UTC MUST be represented as “-00:00”.
(3) If this item is not provided, each recipient is free to set its own policy as to when the message is no longer in effect.
  $alert->getExpires();

setExpires($val)

sets the value of the Onset

This method uses strtotime() to convert a given time string to the CAP DateTime

posible values:



The expiry time of the information of the alert message (OPTIONAL)
(1) The date and time SHALL be represented in the DateTime Data Type (See Implementation Notes) format (e.g., “2002-05-24T16:49:00-07:00” for 24 May 2002 at 16:49 PDT).
(2) Alphabetic timezone designators such as “Z” MUST NOT be used.  The timezone for UTC MUST be represented as “-00:00”.
(3) If this item is not provided, each recipient is free to set its own policy as to when the message is no longer in effect.
  $alert->setExpires('2002-05-24T16:49:00-07:00');

getSenderName()

returns the Sender Name

The text naming the originator of the alert message (OPTIONAL)
The human-readable name of the agency or authority issuing this alert.
  $alert->getSenderName();

setSenderName($val)

sets the value of the Sender Name

The text naming the originator of the alert message (OPTIONAL)
The human-readable name of the agency or authority issuing this alert.
  $alert->setSenderName('SENDERNAME');

getHeadline()

returns the Headline

The text headline of the alert message (OPTIONAL)
A brief human-readable headline.  Note that some displays (for example, short messaging service devices) may only present this headline; 
it SHOULD be made as direct and actionable as possible while remaining short.  160 characters MAY be a useful target limit for headline length.
  $alert->getHeadline();

setHeadline($val)

sets the value of the Headline

The text headline of the alert message (OPTIONAL)
A brief human-readable headline.  Note that some displays (for example, short messaging service devices) may only present this headline; 
it SHOULD be made as direct and actionable as possible while remaining short.  160 characters MAY be a useful target limit for headline length.
  $alert->setHeadline('HEADLINE');

getDescription()

returns the Description

The text describing the subject event of the alert message (OPTIONAL)
An extended human readable description of the hazard or event that occasioned this message.
  $alert->getDescription();

setDescription($val)

sets the value of the Description

The text describing the subject event of the alert message (OPTIONAL)
An extended human readable description of the hazard or event that occasioned this message.
  $alert->setDescription('DESCRIPTION');

getInstruction()

returns the Instruction

The text describing the recommended action to be taken by recipients of the alert message (OPTIONAL)
An extended human readable instruction to targeted recipients.  
If different instructions are intended for different recipients, they should be represented by use of multiple <info> blocks.
  $alert->getInstruction();

setInstruction($val)

sets the value of the Instruction

The text describing the recommended action to be taken by recipients of the alert message (OPTIONAL)
An extended human readable instruction to targeted recipients.  
If different instructions are intended for different recipients, they should be represented by use of multiple <info> blocks.
  $alert->setInstruction('INSTUCTION');

getWeb()

returns the Web

The identifier of the hyperlink associating additional information with the alert message (OPTIONAL)
A full, absolute URI for an HTML page or other text resource with additional or reference information regarding this alert.
  $alert->getWeb();

setWeb($val)

sets the value of the Web

The identifier of the hyperlink associating additional information with the alert message (OPTIONAL)
A full, absolute URI for an HTML page or other text resource with additional or reference information regarding this alert.
  $alert->setWeb('WEB');

getContact()

returns the Instruction

The text describing the contact for follow-up and confirmation of the alert message (OPTIONAL)
  $alert->getContact();

setContact($val)

sets the value of the Instruction

The text describing the contact for follow-up and confirmation of the alert message (OPTIONAL)
A full, absolute URI for an HTML page or other text resource with additional or reference information regarding this alert.
  $alert->setContact('CONTACT');

getParameter()

returns the Parameter Array

A system-specific additional parameter associated with the alert message (OPTIONAL)
(1) Any system-specific datum, in the form:
<parameter>
  <valueName>valueName</valuename>
  <value>value</value>
</parameter>
 where the content of “valueName” is a user-assigned string designating the domain of the code, and the content of “value” is a string (which may represent a number) denoting the value itself (e.g., valueName ="SAME" and value="CIV").
(2) Values of “valueName” that are acronyms SHOULD be represented in all capital letters without periods (e.g., SAME, FIPS, ZIP).
(3) Multiple instances MAY occur within an <info> block.
  $alert->getParameter();

setParameter($valn, $val, $index = false)

sets the value of the Parameter

A system-specific additional parameter associated with the alert message (OPTIONAL)
(1) Any system-specific datum, in the form:
<parameter>
  <valueName>valueName</valuename>
  <value>value</value>
</parameter>
 where the content of “valueName” is a user-assigned string designating the domain of the code, and the content of “value” is a string (which may represent a number) denoting the value itself (e.g., valueName ="SAME" and value="CIV").
(2) Values of “valueName” that are acronyms SHOULD be represented in all capital letters without periods (e.g., SAME, FIPS, ZIP).
(3) Multiple instances MAY occur within an <info> block.
  $alert->setParameter('PARAMETER_NAME', 'PARAMETER_VALUE', INDEX_NUM);

getResource($index)

returns the instanz of the resourceBlock on the given index (default: 0)

setResource($index = false)

create a new resourceBlock instanz at the given index

this will create a new resource block part of the cap

  $cap->setResource();

addResource($index = false)

redirect of setResource()

  $cap->addResource();

getArea($index)

returns the instanz of the areaBlock on the given index (default: 0)

setArea($index = false)

create a new areaBlock instanz at the given index

this will create a new area block part of the cap

  $cap->setArea();

addArea($index = false)

redirect of setArea()

  $cap->addArea();