/home/noncoupa/public_html_beta/src/Illuminate/Database/Eloquent/Model.php
*/
protected function getBelongsToManyCaller()
{
$self = __FUNCTION__;
return array_first(debug_backtrace(false), function($trace) use ($self)
{
$caller = $trace['function'];
return $caller != 'belongsToMany' and $caller != $self;
/home/noncoupa/public_html_beta/src/Illuminate/Database/Eloquent/Model.php
*/
protected function getBelongsToManyCaller()
{
$self = __FUNCTION__;
return array_first(debug_backtrace(false), function($trace) use ($self)
{
$caller = $trace['function'];
return $caller != 'belongsToMany' and $caller != $self;
/home/noncoupa/public_html_beta/src/Illuminate/Support/helpers.php
* @param mixed $default
* @return mixed
*/
function array_first($array, $callback, $default = null)
{
foreach ($array as $key => $value)
{
if (call_user_func($callback, $key, $value)) return $value;
}
/home/noncoupa/public_html_beta/src/Illuminate/Database/Eloquent/Model.php
$self = __FUNCTION__;
return array_first(debug_backtrace(false), function($trace) use ($self)
{
$caller = $trace['function'];
return $caller != 'belongsToMany' and $caller != $self;
});
}
/home/noncoupa/public_html_beta/src/Illuminate/Database/Eloquent/Model.php
* @param string $table
* @param string $foreignKey
* @param string $otherKey
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null)
{
$caller = $this->getBelongsToManyCaller();
// First, we'll need to determine the foreign key and "other key" for the
/home/noncoupa/public_html_beta/packages/Faqs/models/Faq.php
class Faq extends TranslatedModel {
protected $table = 'faqs';
protected $fillable = array('question', 'slug', 'meta_title', 'meta_description', 'og_title', 'og_description', 'short_response', 'response', 'online', 'locale', 'rank');
protected $polyglot = array('question', 'slug', 'meta_title', 'meta_description', 'og_title', 'og_description', 'short_response', 'response', 'online');
public function categories() {
return $this->belongsToMany('GlobalCategories\\Category', 'globalcategories_link', 'owner_id', 'category_id')->where('owner_type',Config::get('faqs::model_name'));
}
/home/noncoupa/public_html_beta/src/Twig/Template.php
return true;
}
if ($this->env->hasExtension('sandbox')) {
$this->env->getExtension('sandbox')->checkMethodAllowed($object, $method);
}
$ret = call_user_func_array(array($object, $method), $arguments);
// useful when calling a template method from a template
/home/noncoupa/public_html_beta/tmp/cache/view/02/03/a85f3d6bb1d408332b220ba07cee.php
$context['_parent'] = (array) $context;
$context['_seq'] = twig_ensure_traversable((isset($context["faqs"]) ? $context["faqs"] : null));
$context['_iterated'] = false;
foreach ($context['_seq'] as $context["_key"] => $context["faq"]) {
// line 33
echo " <li class=\"";
$context['_parent'] = (array) $context;
$context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute((isset($context["faq"]) ? $context["faq"] : null), "categories", array(), "method"), "get", array(), "method"));
foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
echo twig_escape_filter($this->env, ("faq_" . $this->getAttribute((isset($context["category"]) ? $context["category"] : null), "title")), "html", null, true);
/home/noncoupa/public_html_beta/src/Twig/Template.php
public function displayBlock($name, array $context, array $blocks = array())
{
$name = (string) $name;
if (isset($blocks[$name])) {
$b = $blocks;
unset($b[$name]);
call_user_func($blocks[$name], $context, $b);
} elseif (isset($this->blocks[$name])) {
call_user_func($this->blocks[$name], $context, $blocks);
/home/noncoupa/public_html_beta/tmp/cache/view/74/58/eb73c5c96c69132d4cba9050656d.php
</div>
</div>
</header>
<main id=\"main-content\">
";
// line 157
$this->displayBlock('content', $context, $blocks);
// line 158
echo " </main>
/home/noncoupa/public_html_beta/src/Twig/Template.php
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = array())
{
try {
$this->doDisplay($context, $blocks);
} catch (Twig_Error $e) {
if (!$e->getTemplateFile()) {
/home/noncoupa/public_html_beta/src/Twig/Template.php
}
/**
* {@inheritdoc}
*/
public function display(array $context, array $blocks = array())
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), $blocks);
}
/home/noncoupa/public_html_beta/tmp/cache/view/02/03/a85f3d6bb1d408332b220ba07cee.php
return $this->env->resolveTemplate((isset($context["layout"]) ? $context["layout"] : null));
}
protected function doDisplay(array $context, array $blocks = array())
{
// line 3
$context["activeLink"] = 6;
$this->getParent($context)->display($context, array_merge($this->blocks, $blocks));
}
/home/noncoupa/public_html_beta/src/Twig/Template.php
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = array())
{
try {
$this->doDisplay($context, $blocks);
} catch (Twig_Error $e) {
if (!$e->getTemplateFile()) {
/home/noncoupa/public_html_beta/src/Twig/Template.php
}
/**
* {@inheritdoc}
*/
public function display(array $context, array $blocks = array())
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), $blocks);
}
/home/noncoupa/public_html_beta/src/Twig/Template.php
* {@inheritdoc}
*/
public function render(array $context)
{
$level = ob_get_level();
ob_start();
try {
$this->display($context);
} catch (Exception $e) {
while (ob_get_level() > $level) {
/home/noncoupa/public_html_beta/src/Twig/Environment.php
* @param string $name The template name
* @param array $context An array of parameters to pass to the template
*
* @return string The rendered template
*/
public function render($name, array $context = array())
{
return $this->loadTemplate($name)->render($context);
}
/home/noncoupa/public_html_beta/src/Anekdotes/View/View.php
$vars = $this->values;
$defaultlayoutPath = Config::get('app.default_layout', null);
if ($this->layout != '' && $this->loader->exists($this->layout)) {
$vars['layout'] = $this->twig->loadTemplate($this->layout);
} else if ($defaultlayoutPath != null && $this->loader->exists($defaultlayoutPath)) {
$vars['layout'] = $this->twig->loadTemplate($defaultlayoutPath);
}
return $this->twig->render($fullPath, $vars);
} else {
throw new HttpException('Template file not found ('.$fullPath.')', 500);
/home/noncoupa/public_html_beta/src/Anekdotes/Http/Response.php
public function setContent($content) {
$this->original = $content;
if ($this->shouldBeJson($content)) {
$this->headers->set('Content-Type', 'application/json');
$content = $this->morphToJson($content);
} elseif ($content instanceof RenderableInterface){
$content = $content->render();
}
/home/noncoupa/public_html_beta/src/Anekdotes/Http/ViewResponse.php
}
public function setContent($view) {
if (!$view instanceof \Anekdotes\View\View) {
throw new ArgumentException('Response view must be an instance of \Anekdotes\View\View.');
}
return parent::setContent($view);
}
/home/noncoupa/public_html_beta/src/Anekdotes/Http/Response.php
510 => 'Not Extended', // RFC2774
511 => 'Network Authentication Required', // RFC6585
);
public function __construct($content = '', $status = 200, $headers = array()) {
$this->headers = new Registry();
$this->cookies = array();
$this->setContent($content);
$this->setStatusCode($status);
}
/home/noncoupa/public_html_beta/src/Anekdotes/Http/ViewResponse.php
handles well objects that implements Renderable interface but we might want to do some
special voodo magic in the Router if the response is a View, having a class name to do
some "instanceof" check's will be useful.
*/
class ViewResponse extends Response {
public function __construct($view, $status = 200, $headers = array()) {
parent::__construct($view, $status, $headers);
}
/home/noncoupa/public_html_beta/src/Anekdotes/View/View.php
public function make($path, $data = array(), $fromRoot = false, $status = 200) {
$view = new self($path, $data, $fromRoot);
$view->setLoader($this->getLoader());
$view->setTwig($this->getTwig());
$view->setExtensionContainer($this->getExtensionContainer());
$view->setPrefix($this->getPrefix());
$view->setLayout($this->getLayout());
$response = new ViewResponse($view, $status);
return $response;
}
/home/noncoupa/public_html_beta/src/Anekdotes/Support/Facades/ServiceFacade.php
case 0:
return $instance->$method();
case 1:
return $instance->$method($args[0]);
case 2:
return $instance->$method($args[0], $args[1]);
case 3:
/home/noncoupa/public_html_beta/app/controllers/frontend/FaqsController.php
$faqs = Faq::join('faqs_lang', 'faqs.id', '=', 'faqs_lang.id')
->where('faqs_lang.locale', $locale)
->where('faqs_lang.online', true)
->get();
return View::make('@frontend/../pages/faq/index', array(
'faqs' => $faqs
));
}
/home/noncoupa/public_html_beta/src/Anekdotes/Router/Route.php
if ($beforeResult instanceof \Anekdotes\View\View || $beforeResult instanceof \Anekdotes\Router\Redirector || gettype($beforeResult) == 'string') {
return $beforeResult;
}
// Call method
if (method_exists($controller, $action)) {
$result = call_user_func_array(
array($controller, $action),
$params
);
/home/noncoupa/public_html_beta/src/Anekdotes/Router/Route.php
);
}
elseif ($this->actiontype == static::A_CONTROLLER_ACTION) {
$controllerAndAction = explode('@', $this->action);
$controllerName = '\\'.ltrim($controllerAndAction[0], '\\');
$controller = new $controllerName($app);
return $this->executeControllerAction(
$controller,
$controllerAndAction[1],
$routeParamsValues
/home/noncoupa/public_html_beta/src/Anekdotes/Router/Router.php
$currentUri = Request::uri(); // More speedy to not request each time
foreach (static::$routes as $route) {
if ($route->match($currentUri)) {
$matchFound = true;
static::$currentRoute = $route;
// Execute the route action
$routeResult = $route->execute($app, $currentUri);
if ($routeResult instanceof \Anekdotes\Http\Response) {
$app->response = $routeResult;
/home/noncoupa/public_html_beta/src/Anekdotes/Application/Application.php
$app->response->setContent('An error occured during the execution of your request! (500)');
});
// Execute request
ob_start();
try {
$this->runFilters('before');
Router::run($this);
$this->runFilters('after');
} catch(HttpException $e) {
/home/noncoupa/public_html_beta/index.php
<?php
require __DIR__.'/app/autoload.php';
$app = require __DIR__.'/app/start.php';
$app->run();
$app->shutdown();