Loading all elements of Links table

Discussion in 'aMember Pro v.4' started by gogoseo, Nov 27, 2013.

  1. gogoseo

    gogoseo Member

    Joined:
    Nov 17, 2012
    Messages:
    36
    Hello,

    i can get one element from "Link" table like that:
    Am_Di::getInstance()->linkTable->load(22);

    How could i get ALL elements from "Link" table as array?
    I would then like to execute this on them
    $url = $link->getUrl();
  2. gogoseo

    gogoseo Member

    Joined:
    Nov 17, 2012
    Messages:
    36
    Ok, i somehow managed to get the the elements form the Links table. Using:

    $links_array = Am_Di::getInstance()->linkTable->selectObjects("SELECT * FROM ?_link");

    So now i can do something like this:
    foreach ($links_array as $l){
    echo $l->getUrl(); //displays all of the URLs for the Links
    }

    In the amember admin area I assigned one Product for each of those Links.
    How could i now get the assigned Product for each Link in PHP?

Share This Page