<?
namespace front\factory;
class Shop
{
  static public function baselinker_settings( $admin = false )
  {
    global $mdb;

    if ( !$settings = \Cache::fetch( 'baselinker_settings' ) or $admin )
    {
      $results = $mdb -> select( 'pp_shop_baselinker_settings', '*' );
      if ( is_array( $results ) ) foreach ( $results as $row )
        $settings[ $row['name'] ] = $row['value'];

      if ( !$admin)
        \Cache::store( 'baselinker_settings', $settings );
    }

    return $settings;
  }
}