public function getUser() {
return $this->hasOne(User::className(), ['id' => 'from_id']);
}
$models = Message::find()->with('user')->limit(3)->all();
var_dump($models);
function isPerpendicularAnotherVector($v) {
$scalar = $v->getX() * $this->getX() + $v->getY() * $this->getY();
if ($scalar == 0)
print('True');
else
print('False');
}
select ct.card_id, count(ct.card_id) as count from card_id ct
where ct.tags_id in (1,2)
group by ct.card_id
having count = 2
public function issetTags($tagIds = [])
{
if (empty($tagIds) || !is_array($tagIds)) {
return $this;
}
foreach ($tagIds as $tagId) {
$this->leftJoin("card_tags t{$tagId}", "t{$tagId}.card_id = catd.id");
$this->andWhere(["t{$tagId}.tags_id" => $tagId]);
}
return $this;
}
if (isset($_POST['Theme'])) {
$GlobalData['Theme'] = $_POST['Theme'];
} else {
$GlobalData['Theme'] = '';
}