Beispiel #1
0
 /**
  * Retrieve a navigation item using it's url.
  *
  * Note that we use LIKE to permit a wildcard as the calling code likely doesn't
  * care about output params appended.
  *
  * @param string $url
  * @param array $url_params
  *
  * @param int|null $parent_id
  *   Optionally restrict to one parent.
  *
  * @return bool|\CRM_Core_BAO_Navigation
  */
 public static function getNavItemByUrl($url, $url_params, $parent_id = NULL)
 {
     $nav = new CRM_Core_BAO_Navigation();
     $nav->parent_id = $parent_id;
     $nav->whereAdd("url LIKE '{$url}?{$url_params}'");
     if ($nav->find(TRUE)) {
         return $nav;
     }
     return FALSE;
 }