改名
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Database;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class HasCount
|
||||
* @package Database
|
||||
*/
|
||||
class HasCount extends HasBase
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param $arguments
|
||||
* @return $this
|
||||
* @throws Exception
|
||||
*/
|
||||
public function __call($name, $arguments)
|
||||
{
|
||||
$this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|null|ActiveRecord
|
||||
* @throws Exception
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
return $this->_relation->count($this->model::className(), $this->value);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user