Example #1
0
 public function incoming()
 {
     $config = App::make('config');
     $vendor = $config->get('app/package/vendor');
     $name = $config->get('app/package/name');
     return $this->hasMany("{$vendor}\\{$name}\\Model\\Eloquent\\Relations", 'to_id')->where('to_type', '=', $this->getTable());
 }
 public function getPaginator()
 {
     $app = App::instance();
     $request = $app['request'];
     $page = $request->get('page', 1);
     $limit = $request->get('limit', 10);
     return new Paginator($request, $page, $limit, $this->total);
 }
Example #3
0
 public static function fromConfig($key, $config)
 {
     $app = App::instance();
     $enabled = $config['enabled'];
     $providers = array_get($config, 'providers', array());
     if (array_key_exists('provider', $config)) {
         $providers = array($config['provider']);
     }
     $options = array_get($options, 'options', array());
     return new static($app, $key, $enabled, $providers, $config);
 }
Example #4
0
 public function getValidationFields()
 {
     $fields = $this->copy();
     $multilanguageFields = $fields->getMultilanguageFields();
     foreach ($multilanguageFields as $field) {
         $fields->forget($field->getKey());
         $copy = clone $field;
         $newKey = $field->getKey() . '_' . App::make('locale');
         $copy->setKey($newKey);
         $fields->addField($newKey, $copy);
     }
     return $fields;
 }
 public function add($key, $config)
 {
     $contentTypeFactory = App::make('contenttype.factory');
     $this->items[$key] = $contentTypeFactory->fromConfig($key, $config);
     return $this;
 }
 public function add($key, $config)
 {
     $extensionFactory = App::make('extension.factory');
     $this->items[$key] = $extensionFactory->fromConfig($key, $config);
     return $this;
 }