/** * Builds an OMB_Notice object from array * * The method builds an OMB_Notice object from the passed parameters array. * The array MUST provide a notice URI and content. The array fields HAVE TO * be named according to the OMB standard, i. e. omb_notice_* and * omb_seealso_*. Values are handled as not passed if the corresponding array * fields are not set or the empty string. * * @param object $author An OMB_Profile object representing the author of * the notice. * @param string $parameters An array containing the notice parameters. * * @access public * * @returns OMB_Notice The built OMB_Notice. */ public static function fromParameters($author, $parameters) { $notice = new OMB_Notice($author, $parameters['omb_notice'], $parameters['omb_notice_content']); if (isset($parameters['omb_notice_url'])) { $notice->setURL($parameters['omb_notice_url']); } if (isset($parameters['omb_notice_license'])) { $notice->setLicenseURL($parameters['omb_notice_license']); } if (isset($parameters['omb_seealso'])) { $notice->setSeealsoURL($parameters['omb_seealso']); } if (isset($parameters['omb_seealso_disposition'])) { $notice->setSeealsoDisposition($parameters['omb_seealso_disposition']); } if (isset($parameters['omb_seealso_mediatype'])) { $notice->setSeealsoMediatype($parameters['omb_seealso_mediatype']); } if (isset($parameters['omb_seealso_license'])) { $notice->setSeealsoLicenseURL($parameters['omb_seealso_license']); } return $notice; }