Dynamic query options - stat relations ignored

Hello, i think i’ve found a bug.

I’m using lazy loading with dynamic query options. I also use ‘with’ parameter to eagerly load some relations. One of them is “STAT” relation and is ignored (not loaded eagerly).

I’m using something like this:


  'with'=>array('author', 'numberOfEditors')


The "author" relation is "BELONGS_TO" relation and is loaded eagerly. OK.

The “numberOfEditors” is a STAT relation and it’s ignored when lazy loading posts. There is no additional query which i would expect.

When I foreach ($posts as $post) and use $post->numberOfEditors then it’s lazy loaded for every post.

Isn’t it a bug?

I have traced the log and there is a check for the table the stat relation applies to.

"SHOW COLUMNS FROM …" and "SHOW CREATE TABLE …" just after the message similar to "lazy loading User.posts".

Any ideas?