Blame view

thread/modules/seo/helpers/CommonFunc.php 876 Bytes
d1f8bd40   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  <?php
  
  namespace thread\modules\seo\helpers;
  
  use thread\app\base\models\ActiveRecord;
  
  /**
   * Class CommonFunc
   *
   * @package thread\modules\seo\helpers
   * @author FilamentV <vortex.filament@gmail.com>
   * @copyright (c), Thread
   */
  class CommonFunc
  {
      const META_ROBOT_INDEX_FOLLOW = 1;
      const META_ROBOT_INDEX_NOFOLLOW = 2;
      const META_ROBOT_NOINDEX_FOLLOW = 3;
      const META_ROBOT_NOINDEX_NOFOLLOW = 4;
  
      /**
       * @return array
       */
      public static function statusMetaRobotsRange()
      {
          return [
              1 => 'index, follow',
              2 => 'index, nofollow',
              3 => 'noindex, follow',
              4 => 'noindex, nofollow'
          ];
      }
  
      /**
       * @param ActiveRecord $model
       * @return string
       */
      public static function getModelKey(ActiveRecord $model)
      {
          return sha1($model::tableName());
      }
  }