Mapping/PropertyDefinition.php
private function findSetter()
    {
        $reflClass = new \ReflectionClass($this->class);

        $setter = 'set' . $this->camelize($this->name);
        $classHasProperty = $reflClass->hasProperty($this->name);

        if ($reflClass->hasMethod($setter) && $reflClass->getMethod($setter)->isPublic()) {
            $this->setter = $setter;
            $this->setterType = self::GETTER_SETTER_METHOD;
        } elseif ((0 === strpos($this->name, 'set')) && $reflClass->hasMethod($this->name) && $reflClass->getMethod($this->name)->isPublic()) {
            $this->setter = $this->name;
            $this->setterType = self::GETTER_SETTER_METHOD;
        } elseif (($reflClass->hasMethod('__set') && $reflClass->getMethod('__set')->isPublic()) ||
                  ($classHasProperty && $reflClass->getProperty($this->name)->isPublic())) {
            $this->setter = $this->name;
            $this->setterType = self::GETTER_SETTER_PROPERTY;
        // } elseif ($this->magicCall && $reflClass->hasMethod('__call') && $reflClass->getMethod('__call')->isPublic()) {
        //     // we call the getter and hope the __call do the job
        //     $object->$setter($value);
        }
    }
private function findSetter()
    {
        $reflClass = new \ReflectionClass($this->class);

        $setter = 'set' . $this->camelize($this->name);
        $classHasProperty = $reflClass->hasProperty($this->name);

        if ($reflClass->hasMethod($setter) && $reflClass->getMethod($setter)->isPublic()) {
            $this->setter = $setter;
            $this->setterType = self::GETTER_SETTER_METHOD;
        } elseif ((0 === strpos($this->name, 'set')) && $reflClass->hasMethod($this->name) && $reflClass->getMethod($this->name)->isPublic()) {
            $this->setter = $this->name;
            $this->setterType = self::GETTER_SETTER_METHOD;
        } elseif (($reflClass->hasMethod('__set') && $reflClass->getMethod('__set')->isPublic()) ||
                  ($classHasProperty && $reflClass->getProperty($this->name)->isPublic())) {
            $this->setter = $this->name;
            $this->setterType = self::GETTER_SETTER_PROPERTY;
        // } elseif ($this->magicCall && $reflClass->hasMethod('__call') && $reflClass->getMethod('__call')->isPublic()) {
        //     // we call the getter and hope the __call do the job
        //     $object->$setter($value);
        }
    }
Try to find the setter associated to this property

Simplified version of {@link Symfony\Component\PropertyAccess\PropertyAccessor}.