本文整理汇总了PHP中zibo\library\String::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP String::isEmpty方法的具体用法?PHP String::isEmpty怎么用?PHP String::isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zibo\library\String
的用法示例。
在下文中一共展示了String::isEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setTitle
/**
* Sets the title of this content
* @param string $title
* @return null
* @throws zibo\ZiboException when the title is empty
*/
private function setTitle($title)
{
if (String::isEmpty($title)) {
throw new ZiboException('Provided title is empty');
}
$this->title = $title;
}
示例2: setFormat
/**
* Sets the format string
* @param string $format
* @return null
* @throws zibo\ZiboException when the provided format is empty or not a string
*/
protected function setFormat($format)
{
if (String::isEmpty($format)) {
throw new ZiboException('Provided format is empty');
}
$this->format = $format;
}
示例3: setTitle
public function setTitle($title)
{
if (!$title instanceof Exception && String::isEmpty($title)) {
throw new ZiboException('Empty title provided');
}
$this->title = $title;
}
示例4: setName
/**
* Sets the name of the queue
* @param string $name The name of the queue
* @return null
*/
protected function setName($name)
{
if (String::isEmpty($name)) {
throw new ZiboException('Could not set the name of the queue worker: provided name is empty');
}
$this->name = $name;
}
示例5: setName
/**
* Set the name of the validator
* @param string $name
* @return null
* @throws zibo\ZiboException when $name is not a string
* @throws zibo\library\orm\exception\ModelException when $name is empty
*/
private function setName($name)
{
if (String::isEmpty($name)) {
throw new OrmException('Name is empty');
}
$this->name = $name;
}
示例6: setRelationOrder
/**
* Sets the order statement string for the relation
* @param string $order
* @return null
*/
public function setRelationOrder($order)
{
if ($order !== null && String::isEmpty($order)) {
throw new OrmException('Provided order statement is empty');
}
$this->relationOrder = $order;
}
示例7: setName
/**
* Sets the name of the namespace
* @param string $name
* @return null
* @throws zibo\ZiboException when the provided name is empty or invalid
*/
private function setName($name)
{
if (String::isEmpty($name)) {
throw new ZiboException('Provided name is empty');
}
$this->name = $name;
}
示例8: register
/**
* Register an ImageIO to this factory
* @param string extension extension of the images the IO will handle
* @param ImageIO ImageIO for this extension
*/
public function register($extension, ImageIO $io)
{
if (String::isEmpty($extension)) {
throw new ImageException('extension is empty');
}
$this->io[$extension] = $io;
}
示例9: setLabel
/**
* Sets the label for this field
* @param string $label Translation key for the name of this field
* @return null
*/
public function setLabel($label)
{
if ($label !== null && String::isEmpty($label)) {
throw new OrmException('Provided label is empty');
}
$this->label = $label;
}
示例10: setChangeKey
/**
* Sets the change key
* @param string $changeKey
* @return null
* @throws InvalidArgumentException when the changeKey is empty
*/
public function setChangeKey($changeKey)
{
if ($changeKey !== null && String::isEmpty($changeKey)) {
throw new InvalidArgumentException('Provided change key is empty');
}
$this->ChangeKey = $changeKey;
}
示例11: addAllowedName
public function addAllowedName($name)
{
if (String::isEmpty($name)) {
throw new ZiboException('Provided name is empty');
}
$this->names[] = $name;
}
示例12: setExportUrl
/**
* Sets the URL to the export
* @param string $url
* @return null
* @throws zibo\ZiboException when the provided URL is empty or invalid
*/
public function setExportUrl($url)
{
if (String::isEmpty($url)) {
throw new ZiboException('Provided export URL is empty or invalid');
}
$this->exportUrl = $url;
}
示例13: hasModel
/**
* Gets whether this register has a model by the provided name
* @param string $modelName Name of the model
* @return boolean True if the register has the provided model registered, false otherwise
* @throws zibo\library\orm\exception\OrmException when the provided model name is empty
*/
public function hasModel($modelName)
{
if (String::isEmpty($modelName)) {
throw new OrmException('Provided modelname is empty');
}
return array_key_exists($modelName, $this->models);
}
示例14: registerService
/**
* Registers a service to this server instance
* @param string $name The name of the service
* @param string|array|zibo\library\Callback $callback The callback with the logic of the service
* @param string $returnType The type of the resulting value
* @param array $parameterTypes The types of parameters for this service
* @param string $description A description of this service
* @return null
* @throws zibo\library\xmlrpc\exception\XmlRpcException when the name of the service is empty
* @throws zibo\library\xmlrpc\exception\XmlRpcException when the name of the service is already used by another service
* @throws zibo\library\xmlrpc\exception\XmlRpcException when a invalid return type or parameter type has been detected
* @throws zibo\library\xmlrpc\exception\XmlRpcException when the description is not a valid string
*/
public function registerService($name, $callback, $returnType = 'string', $parameterTypes = null, $description = null)
{
if (String::isEmpty($name)) {
throw new XmlRpcException('Name of the service is empty');
}
if (isset($this->services[$name])) {
throw new XmlRpcException($name . ' service already registered');
}
$callback = new Callback($callback);
if (!Value::isValidType($returnType)) {
throw new XmlRpcException('Return type ' . $returnType . ' is not a valid type');
}
if ($parameterTypes == null) {
$parameterTypes = array();
} elseif (!is_array($parameterTypes)) {
$parameterTypes = array($parameterTypes);
}
foreach ($parameterTypes as $type) {
if (!Value::isValidType($type)) {
throw new XmlRpcException('Parameter type ' . $type . ' is not a valid type');
}
}
if ($description != null && !is_string($description)) {
throw new XmlRpcException('Provided description is not a string');
}
$service = array(self::SERVICE_CALLBACK => $callback, self::SERVICE_RETURN_TYPE => $returnType, self::SERVICE_PARAMETERS_TYPES => $parameterTypes, self::SERVICE_DESCRIPTION => $description);
$this->services[$name] = $service;
}
示例15: setName
/**
* Set the name of this theme
* @param string $name
* @return null
* @throws zibo\ZiboException when the provided name is invalid
*/
private function setName($name)
{
if (String::isEmpty($name)) {
throw new ZiboException('Name of the region is empty');
}
$this->name = $name;
}