/** * @param int $providerId * @return ProviderInfo[] * @throws \Exception */ public function get($providerId = null) { MDataType::mustBe(array(MDataType::INT)); $toReturn = array(); $sql = "CALL mt_provider_get(?);"; $query = new MPDOQuery($sql, $this->connection); $query->bindValue($providerId); $queryResult = $query->exec(); if ($queryResult == false || $query->getResult()->rowCount() <= 0) { return $toReturn; } foreach ($query->getResult() as $row) { $userLogins = new ProviderInfo(); $userLogins->setName($row['name'])->setAppKey($row['app_key'])->setSecretKey($row['secret_key'])->setId((int) $row['id']); $toReturn[] = $userLogins; } return $toReturn; }
/** * @param string $path * @return void */ private function removeFolder($path) { MDataType::mustBe(MDataType::STRING); if (!file_exists($path)) { return; } if (!is_dir($path)) { unlink($path); } foreach (scandir($path) as $item) { if ($item == '.' || $item == '..') { continue; } $this->removeFolder($path . DIRECTORY_SEPARATOR . $item); } rmdir($path); }
/** * @param string $tableName * @return MMySQLCacheManager */ private function setTableName($tableName) { MDataType::mustBe(MDataType::STRING); $this->tableName = $tableName; return $this; }
/** * @param string $text * @return string */ public function getHash($text) { MDataType::mustBe(array(MDataType::STRING)); return hash($this->hashAlgorithm, $text); }
/** * Removes the item with the key <i>$key</i> from the map and returns the value associated with it. * * @param mixed $key * @return mixed * @throws MWrongTypeException */ public function take($key) { MDataType::mustBe(array(MDataType::STRING)); $key = $this->getValue($key); $this->remove($key); return $key; }
/** * @param int $ttl * @return MCacheItem */ public function setTtl($ttl) { MDataType::mustBe(MDataType::INT); $this->ttl = $ttl; return $this; }
/** * @param int $pageSize * @return Pagination */ public function setPageSize($pageSize) { MDataType::mustBe(MDataType::INT); $this->pageSize = $pageSize; return $this; }
/** * @param string $name * @return Provider */ public function setName($name) { MDataType::mustBe(array(MDataType::STRING)); $this->name = $name; return $this; }
/** * @param boolean $enabled * @return User */ public function setEnabled($enabled) { MDataType::mustBe(array(MDataType::BOOLEAN)); $this->enabled = $enabled; return $this; }
public function offsetGet_string($offset) { MDataType::mustBe(MDataType::STRING); if ($this->offsetExists_string($offset)) { return $this->record[$offset]; } return null; }
/** * @param int $offset */ public function offsetUnset($offset) { MDataType::mustBe(array(MDataType::INT)); if ($this->offsetExists($offset)) { unset($this->vector[$offset]); } }
/** * Constructs a time with hour <i>$h</i>, minute <i>$m</i>, seconds <i>$s</i> and milliseconds <i>ms</i>. * * @param int $h * @param int $m * @param int $s * @param int $ms */ public function __construct($h = 0, $m = 0, $s = 0, $ms = 0) { MDataType::mustBe(array(MDataType::INT, MDataType::INT, MDataType::INT, MDataType::INT)); $this->setHMS($h, $m, $s, $ms); }
/** * @param string $output * @return MHttpResponse */ public function appendOutput($output) { MDataType::mustBe(array(MDataType::STRING)); $this->output .= $output; return $this; }
/** * @param int $start * @param int $end * @return \MToolkit\Core\MList */ public function slice($start, $end) { MDataType::mustBe(array(MDataType::INT, MDataType::INT)); $list = array_slice($this->list, $start, $end); return new MList($list); }