title: Yii2 ActiveRecord cache
body: <p>How to use ActiveRecotd cache for Yii 2? I did't find any examples in official docs. In Google I found 2 examples, first is:</p>
  
  <pre><code>$db = self::getDb();
  $object = $db-&gt;cache(function ($db) use($id) {
      return self::findOne($id);
  });
  </code></pre>
  
  <p>But it doesn't work for <code>Model</code>, I tested with updated framework. Other example is:</p>
  
  <pre><code>$data = \Yii::$app-&gt;cache-&gt;get('some_var_' . $id);
  if ($data === false)
  {
      $data = self::findOne($id);
      \Yii::$app-&gt;cache-&gt;set('some_var_' . $id, $data, 60);
  }
  </code></pre>
  
  <p>It's working fine, but it's not ActiveRecord caching it's data caching, So we haven't got ActiveRecord caching in Yii 2?</p>