function testDoubleS() { $this->assertEquals('access', Reflection::singularizeProperty('access')); }
/** * @param string $property * @return string * @throws Exception */ private function getSearchableProperty($property) { $property = Meta\Reflection::singularizeProperty($property); foreach ($this->meta->getIndexedProperties() as $p) { if (Meta\Reflection::singularizeProperty($p->getName()) == $property) { return $property; } } throw new Exception("Property {$property} is not indexed."); }
/** * @param $names * @return bool */ function matches($names) { foreach (func_get_args() as $name) { if (0 === strcasecmp($name, $this->name) || 0 === strcasecmp($name, $this->property->getName()) || 0 === strcasecmp($name, Reflection::singularizeProperty($this->property->getName()))) { return true; } } return false; }