本文整理汇总了PHP中Mapper::getImplementation方法的典型用法代码示例。如果您正苦于以下问题:PHP Mapper::getImplementation方法的具体用法?PHP Mapper::getImplementation怎么用?PHP Mapper::getImplementation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapper
的用法示例。
在下文中一共展示了Mapper::getImplementation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: verifySettings
/**
* Checks to make sure all settings are kosher. In this case, it
* means that the dest attribute has been set and we have a mapper.
*/
public function verifySettings()
{
if ($this->targetdir === null) {
$this->setError("The targetdir attribute is required.");
}
if ($this->map === null) {
if ($this->mapperElement === null) {
$this->map = new IdentityMapper();
} else {
$this->map = $this->mapperElement->getImplementation();
if ($this->map === null) {
$this->setError("Could not set <mapper> element.");
}
}
}
}
示例2: getMappedFile
/**
* Maps the passed in name to a new filename & returns resolved File object.
* @param string $from
* @return PhingFile Resolved File object.
* @throws BuilException - if no Mapper element se
* - if unable to map new filename.
*/
protected function getMappedFile($from)
{
if (!$this->mapperElement) {
throw new BuildException("This task requires you to use a <mapper/> element to describe how filename changes should be handled.");
}
$mapper = $this->mapperElement->getImplementation();
$mapped = $mapper->main($from);
if (!$mapped) {
throw new BuildException("Cannot create new filename based on: " . $from);
}
// Mappers always return arrays since it's possible for some mappers to map to multiple names.
$outFilename = array_shift($mapped);
$outFile = new PhingFile($this->getOutputDirectory(), $outFilename);
return $outFile;
}
示例3: addMapper
/**
* Add a <code>Mapper</code>.
* @param Mapper $mapper the <code>Mapper</code> to add.
*/
public function addMapper(Mapper $mapper)
{
$this->add($mapper->getImplementation());
}