@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public static function all($columns = ['*']) |
| 31 | 31 | { |
| 32 | - $cacheName = 'activerecord.contentcategory.all.' . implode('.', $columns); |
|
| 32 | + $cacheName = 'activerecord.contentcategory.all.'.implode('.', $columns); |
|
| 33 | 33 | $records = MemoryObject::instance()->get($cacheName); |
| 34 | 34 | if ($records === null) { |
| 35 | 35 | $records = parent::all($columns); |
@@ -45,12 +45,12 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public static function getByPath($path = '') |
| 47 | 47 | { |
| 48 | - if (MainApp::$Memory->get('cache.content.category.path.' . $path) !== null) { |
|
| 49 | - return MainApp::$Memory->get('cache.content.category.path.' . $path); |
|
| 48 | + if (MainApp::$Memory->get('cache.content.category.path.'.$path) !== null) { |
|
| 49 | + return MainApp::$Memory->get('cache.content.category.path.'.$path); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $record = self::where('path', '=', $path)->first(); |
| 53 | - MainApp::$Memory->set('cache.content.category.path.' . $path, $record); |
|
| 53 | + MainApp::$Memory->set('cache.content.category.path.'.$path, $record); |
|
| 54 | 54 | return $record; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public static function getById($id) |
| 63 | 63 | { |
| 64 | - if (MainApp::$Memory->get('cache.content.category.id.' . $id) !== null) { |
|
| 65 | - return MainApp::$Memory->get('cache.content.category.id.' . $id); |
|
| 64 | + if (MainApp::$Memory->get('cache.content.category.id.'.$id) !== null) { |
|
| 65 | + return MainApp::$Memory->get('cache.content.category.id.'.$id); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $record = self::find($id); |
| 69 | - MainApp::$Memory->set('cache.content.category.id.' . $id, $record); |
|
| 69 | + MainApp::$Memory->set('cache.content.category.id.'.$id, $record); |
|
| 70 | 70 | return $record; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | } else { |
| 95 | 95 | // set level marker based on slashes count in pathway |
| 96 | 96 | $slashCount = Str::entryCount($path, '/'); |
| 97 | - for ($i=-1; $i <= $slashCount; $i++) { |
|
| 97 | + for ($i = -1; $i <= $slashCount; $i++) { |
|
| 98 | 98 | $title .= '--'; |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | // add canonical title from db |
| 102 | - $title .= ' ' . Serialize::getDecodeLocale($data->title); |
|
| 102 | + $title .= ' '.Serialize::getDecodeLocale($data->title); |
|
| 103 | 103 | // set response as array [id => title, ... ] |
| 104 | 104 | $response[$data->id] = $title; |
| 105 | 105 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public static function all($columns = ['*']) |
| 30 | 30 | { |
| 31 | - $cacheName = 'activerecord.profilefield.all.' . implode('.', $columns); |
|
| 31 | + $cacheName = 'activerecord.profilefield.all.'.implode('.', $columns); |
|
| 32 | 32 | $records = MemoryObject::instance()->get($cacheName); |
| 33 | 33 | if ($records === null) { |
| 34 | 34 | $records = parent::all($columns); |
@@ -19,7 +19,6 @@ |
||
| 19 | 19 | use Ffcms\Core\Exception\NativeException; |
| 20 | 20 | use Ffcms\Core\Exception\NotFoundException; |
| 21 | 21 | use Ffcms\Core\Exception\SyntaxException; |
| 22 | -use Ffcms\Core\Helper\FileSystem\Directory; |
|
| 23 | 22 | use Ffcms\Core\Helper\HTML\SimplePagination; |
| 24 | 23 | use Ffcms\Core\Helper\Type\Obj; |
| 25 | 24 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | public function actionIndex() |
| 44 | 44 | { |
| 45 | 45 | // set current page and offset |
| 46 | - $page = (int)$this->request->query->get('page'); |
|
| 46 | + $page = (int) $this->request->query->get('page'); |
|
| 47 | 47 | $offset = $page * self::ITEM_PER_PAGE; |
| 48 | 48 | |
| 49 | 49 | $query = null; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } elseif ($type === 'moderate') { // only items on moderate |
| 55 | 55 | $query = ContentEntity::where('display', '=', 0); |
| 56 | 56 | } elseif (Obj::isLikeInt($type)) { // sounds like category id ;) |
| 57 | - $query = ContentEntity::where('category_id', '=', (int)$type); |
|
| 57 | + $query = ContentEntity::where('category_id', '=', (int) $type); |
|
| 58 | 58 | } else { |
| 59 | 59 | $query = new ContentEntity(); |
| 60 | 60 | $type = 'all'; |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | public function actionCategoryupdate($id = null) |
| 269 | 269 | { |
| 270 | 270 | // get owner id for new rows |
| 271 | - $parentId = (int)$this->request->query->get('parent'); |
|
| 271 | + $parentId = (int) $this->request->query->get('parent'); |
|
| 272 | 272 | |
| 273 | 273 | // get relation and pass to model |
| 274 | 274 | $record = ContentCategory::findOrNew($id); |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * FormCommentUpdate constructor. Pass record inside the model. |
| 22 | - * @param \Apps\ActiveRecord\CommentPost|\Apps\ActiveRecord\CommentAnswer $record |
|
| 22 | + * @param \Ffcms\Core\Arch\ActiveModel $record |
|
| 23 | 23 | */ |
| 24 | 24 | public function __construct($record, $type = 'comment') |
| 25 | 25 | { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | // render view output |
| 37 | 37 | return $this->view->render('index', [ |
| 38 | - 'model' => $model |
|
| 38 | + 'model' => $model |
|
| 39 | 39 | ]); |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | \ No newline at end of file |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $search = \Apps\ActiveRecord\App::getItem('widget', $controller); |
| 88 | 88 | |
| 89 | 89 | // check what we got |
| 90 | - if ($search === null || (int)$search->id < 1) { |
|
| 90 | + if ($search === null || (int) $search->id < 1) { |
|
| 91 | 91 | throw new NotFoundException('Widget is not founded'); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $record = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'widget')->first(); |
| 122 | 122 | |
| 123 | 123 | // check if widget admin controller exists |
| 124 | - if ($record === null || (int)$record->id < 1) { |
|
| 124 | + if ($record === null || (int) $record->id < 1) { |
|
| 125 | 125 | throw new ForbiddenException('Widget is not founded'); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -37,9 +37,9 @@ |
||
| 37 | 37 | $record->save(); |
| 38 | 38 | |
| 39 | 39 | // add user notification |
| 40 | - if ((int)$this->_post->user_id > 0 && $this->_userId !== (int)$this->_post->user_id) { |
|
| 41 | - $notify = new EntityAddNotification((int)$this->_post->user_id); |
|
| 42 | - $uri = '/feedback/read/' . $this->_post->id . '/' . $this->_post->hash . '#feedback-answer-' . $record->id; |
|
| 40 | + if ((int) $this->_post->user_id > 0 && $this->_userId !== (int) $this->_post->user_id) { |
|
| 41 | + $notify = new EntityAddNotification((int) $this->_post->user_id); |
|
| 42 | + $uri = '/feedback/read/'.$this->_post->id.'/'.$this->_post->hash.'#feedback-answer-'.$record->id; |
|
| 43 | 43 | |
| 44 | 44 | $notify->add($uri, EntityAddNotification::MSG_ADD_FEEDBACKANSWER, [ |
| 45 | 45 | 'snippet' => Text::snippet($this->message, 50), |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $status = $this->_record->disabled; |
| 32 | 32 | |
| 33 | - $this->_record->disabled = (int)!$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
| 33 | + $this->_record->disabled = (int) !$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
| 34 | 34 | $this->_record->save(); |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | \ No newline at end of file |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * Load configs from app data |
|
| 31 | - */ |
|
| 30 | + * Load configs from app data |
|
| 31 | + */ |
|
| 32 | 32 | public function before() |
| 33 | 33 | { |
| 34 | 34 | if ($this->_config === null) { |