{@inheritdoc}

{@inheritdoc}

@param integer|string $clientId
{@inheritdoc}

@param string $subject
{@inheritdoc}
555685
public function deleteGrantedScopes($clientId, $subject)
    {
        ValidationUtility::ensureStringOrInteger('$clientId', $clientId);
        ValidationUtility::ensureString('$subject', $subject);

        $request = new GrantedScopesDeleteRequest();
        $request->setSubject($subject);

        return $this->callServicePostApi(
            '\Authlete\Dto\ApiResponse::fromJson',
            self::$GRANTED_SCOPES_DELETE_API_PATH . $clientId,
            null, $request);
    }
448448
public function publish($subject, $payload = null, $inbox = null)
    {
        $msg = 'PUB '.$subject;
        if ($inbox !== null) {
            $msg = $msg.' '.$inbox;
        }

        $msg = $msg.' '.strlen($payload);
        $this->send($msg."\r\n".$payload);
        $this->pubs += 1;
    }
389955
public function fromSubject(JWTSubject $subject)
    {
        $payload = $this->makePayload($subject);

        return $this->manager->encode($payload)->get();
    }
1247164
public function createSubject(Subject $subject)
    {
        $this->om->startFlushSuite();
        $this->om->persist($subject);
        $this->dispatch(new CreateSubjectEvent($subject));
        $this->om->endFlushSuite();

        return $subject;
    }
793327
public function sendSetGroupSubject($gjid, $subject)
    {
        $child = new ProtocolNode('subject', null, null, $subject);
        $node = new ProtocolNode('iq',
            [
                'id'    => $this->createIqId(),
                'type'  => 'set',
                'to'    => $this->getJID($gjid),
                'xmlns' => 'w:g2',
            ], [$child], null);

        $this->sendNode($node);
    }
360574
public function deleteSubjectAction(Subject $subject)
    {
        if ($this->authorization->isGranted('moderate', new ResourceCollection(array($subject->getCategory()->getForum()->getResourceNode())))) {

            $this->manager->deleteSubject($subject);

            return new RedirectResponse(
                $this->generateUrl('claro_forum_subjects', array('category' => $subject->getCategory()->getId()))
            );
        }

        throw new AccessDeniedException();
    }
540614
public function getClientKey($client_id, $subject)
    {
        $result = $this->client->getItem(array(
            "TableName"=> $this->config['jwt_table'],
            "Key" => array('client_id'   => array('S' => $client_id), 'subject' => array('S' => $subject))
        ));
        if ($result->count()==0) {
            return false ;
        }
        $token = $this->dynamo2array($result);

        return $token['public_key'];
    }
59777
public function initialize($subject, $callback=null)
    {
        $class = is_string($subject) ? ltrim($subject,'\\') : $subject::className();

        // initialize the object if needed
        if (!isset($this->_schema[$class])) {
            $builder = new \Pheasant\SchemaBuilder($this);
            $initializer = $callback ? $callback : $class.'::initialize';

            $this->events()->trigger('beforeInitialize', $builder);
            call_user_func($initializer, $builder, $this);
            $schema = $builder->build($class);

            $this->_schema[$class] = $schema;
            $this->events()->trigger('afterInitialize', $schema);
        }

        return $class;
    }
192483
public function subject($subject) {

		if(false === is_string($subject)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($subject)), E_USER_ERROR);
		}

		$this -> subject = $subject;

		return $this;
	}
1207109
public function serialize($subject, &$data = array(), SerializerInterface $serializer = null)
    {
        $context = $this->serializer();
        $context($subject, $data, $serializer);
        return $data;
    }
362259
protected function _error(Subject $subject)
    {
        $subject->set(['success' => false, 'created' => false]);

        $this->_trigger('afterSave', $subject);
        $this->setFlash('error', $subject);
        $this->_trigger('beforeRender', $subject);
    }
83234
private function initializeClient($url, ClientInterface $client = null)
    {
        if ($client) {
            $this->client = $client;
        } else {
            $this->client = new LocalClient($url);
        }
    }
265190
public function getProperty($clientId, $propertyId)
    {
        if (!is_int($clientId)) {
            throw new \InvalidArgumentException('Client ID must be an integer.');
        }

        if (!is_int($propertyId)) {
            throw new \InvalidArgumentException('Property ID must be an integer.');
        }

        $xml = $this->execute(sprintf('branch/%d/property/%d', $clientId, $propertyId));

        $property = new Property;
        $property->setAttributes($xml->attributes());

        $property->setAgentReference(self::normalise($xml->reference->agents, 'string'));

        $address = new Address;
        $address
            ->setName(self::normalise($xml->address->name, 'string'))
            ->setStreet(self::normalise($xml->address->street, 'string'))
            ->setLocality(self::normalise($xml->address->locality, 'string'))
            ->setTown(self::normalise($xml->address->town, 'string'))
            ->setCounty(self::normalise($xml->address->county, 'string'))
            ->setPostcode(self::normalise($xml->address->postcode, 'string'))
            ->setCustomLocation(self::normalise($xml->address->custom_location, 'string'))
            ->setDisplay(self::normalise($xml->address->display, 'string'));

        $property->setAddress($address);

        $price = new Price(self::normalise($xml->price, 'int'));
        $price->setAttributes($xml->price->attributes());
        $property->setPrice($price);

        $property->setRentalFees(self::normalise($xml->rentalfees, 'string'));
        $property->setLettingsFee(self::normalise($xml->lettingsfee, 'string'));
        $property->setRmQualifier(self::normalise($xml->{'rm_qualifier'}, 'int'));
        $property->setAvailable(self::normalise($xml->available, 'string'));
        $property->setUploaded(self::normalise($xml->uploaded, 'string'));
        $property->setLongitude(self::normalise($xml->longitude, 'float'));
        $property->setLatitude(self::normalise($xml->latitude, 'float'));
        $property->setEasting(self::normalise($xml->easting, 'int'));
        $property->setNorthing(self::normalise($xml->northing, 'int'));
        $property->setWebStatus(self::normalise($xml->{'web_status'}, 'int'));
        $property->setCustomStatus(self::normalise($xml->{'custom_status'}, 'string'));
        $property->setCommRent(self::normalise($xml->{'comm_rent'}, 'string'));
        $property->setPremium(self::normalise($xml->premium, 'string'));
        $property->setServiceCharge(self::normalise($xml->{'service_charge'}, 'string'));
        $property->setRateableValue(self::normalise($xml->{'rateable_value'}, 'string'));
        $property->setType(self::normalise($xml->type, 'string'));
        $property->setFurnished(self::normalise($xml->furnished, 'int'));
        $property->setRmType(self::normalise($xml->{'rm_type'}, 'int'));
        $property->setLetBond(self::normalise($xml->{'let_bond'}, 'int'));
        $property->setRmLetTypeId(self::normalise($xml->{'rm_let_type_id'}, 'int'));
        $property->setBedrooms(self::normalise($xml->bedrooms, 'int'));
        $property->setReceptions(self::normalise($xml->receptions, 'int'));
        $property->setBathrooms(self::normalise($xml->bathrooms, 'int'));
        $property->setUserField1(self::normalise($xml->userfield1, 'string'));
        $property->setUserField2(self::normalise($xml->userfield2, 'int'));
        $property->setSoldDate(self::normalise($xml->solddate, 'datetime'));
        $property->setLeaseEnd(self::normalise($xml->leaseend, 'datetime'));
        $property->setInstructed(self::normalise($xml->instructed, 'datetime'));
        $property->setSoldPrice(self::normalise($xml->soldprice, 'int'));
        $property->setGarden(self::normalise($xml->garden, 'boolean'));
        $property->setParking(self::normalise($xml->parking, 'boolean'));
        $property->setNewBuild(self::normalise($xml->newbuild, 'boolean'));
        $property->setGroundRent(self::normalise($xml->groundrent, 'string'));
        $property->setCommission(self::normalise($xml->commission, 'string'));

        if ($xml->landarea) {
            $landArea = new LandArea(
                self::normalise($xml->landarea->area, 'float')
            );
            $landArea->setAttributes($xml->landarea->attributes());
            $property->setLandArea($landArea);
        }

        $property->setStreetView(
            new StreetView(
                self::normalise($xml->streetview->pov_latitude, 'float'),
                self::normalise($xml->streetview->pov_longitude, 'float'),
                self::normalise($xml->streetview->pov_pitch, 'float'),
                self::normalise($xml->streetview->pov_heading, 'float'),
                self::normalise($xml->streetview->pov_zoom, 'int')
            )
        );

        $arr = array();
        foreach ($xml->area as $a) {
            $area = new Area(
                self::normalise($a->min, 'float'),
                self::normalise($a->max, 'float')
            );
            $area->setAttributes($a->attributes());
            $arr[] = $area;
        }
        $property->setArea($arr);

        $property->setDescription(self::normalise($xml->description, 'string'));

        $property->setEnergyEfficiency(
            new EnergyRatingPair(
                self::normalise($xml->hip->energy_performance->energy_efficiency->current, 'int'),
                self::normalise($xml->hip->energy_performance->energy_efficiency->potential, 'int')
            )
        );

        $property->setEnvironmentalImpact(
            new EnergyRatingPair(
                self::normalise($xml->hip->energy_performance->environmental_impact->current, 'int'),
                self::normalise($xml->hip->energy_performance->environmental_impact->potential, 'int')
            )
        );

        $arr = array();
        foreach ($xml->paragraphs->paragraph as $p) {

            $paragraph = new Paragraph;
            $paragraph->setName(self::normalise($p->name, 'string'));
            $paragraph->setFile(self::normalise($p->file->attributes()['ref'], 'int'));
            $paragraph->setDimension(
                new Dimension(
                    self::normalise($p->dimensions->metric, 'string'),
                    self::normalise($p->dimensions->imperial, 'string'),
                    self::normalise($p->dimensions->mixed, 'string')
                )
            );
            $paragraph->setText(self::normalise($p->text, 'string'));
            $paragraph->setAttributes($p->attributes());
            $arr[] = $paragraph;
        }
        $property->setParagraphs($arr);

        $arr = array();
        foreach ($xml->bullets->bullet as $b) {
            $bullet = new Bullet(self::normalise($b, 'string'));
            $bullet->setAttributes($b->attributes());
            $arr[$bullet->getAttribute('id')] = $bullet;
        }
        $property->setBullets($arr);

        $arr = array();
        foreach ($xml->files->file as $f) {
            $file = new File;
            $file->setName(self::normalise($f->name, 'string'));
            $file->setUrl(self::normalise($f->url, 'string'));
            $file->setUpdated(self::normalise($f->updated, 'datetime'));
            $file->setAttributes($f->attributes());
            $arr[$file->getAttribute('id')] = $file;
        }
        $property->setFiles($arr);

        return $property;
    }
960266
public void addSubject(String[] subject) {
		XmpArray array = new XmpArray(XmpArray.UNORDERED);
		for (int i = 0; i < subject.length; i++) {
			array.add(subject[i]);
		}
		setProperty(SUBJECT, array);
	}
1046274
public function send(string $address, string $subject, ?string $message = null): bool
    {
        // try to get message from global if not passed direct
        if ($message === null) {
            $message = $this->message;
        }

        try {
            if ($message === null) {
                throw new \Exception('Message body is empty!');
            }

            // try to build message and send it
            $message = (new \Swift_Message($subject))
                ->setFrom($this->from)
                ->setTo($address)
                ->setBody($message, 'text/html');
            $this->swift->send($message);
            return true;
        } catch (\Exception $e) {
            if (App::$Debug) {
                App::$Debug->addException($e);
                App::$Debug->addMessage('Send mail failed! Info: ' . $e->getMessage(), 'error');
            }
            return false;
        }
    }
1301441
public static function create(
        $subject = null,
        $body = null,
        $priority = null,
        $type = null,
        $channel = null,
        $role = null,
        $user = null,
        \DateTime $createdAt = null)
    {
        if ($subject === null) {
            $subject = static::getDefaultSubject();
        }

        if ($body === null) {
            $body = static::getDefaultBody();
        }

        if ($priority === null) {
            $priority = static::getDefaultPriority();
        }

        if ($type === null) {
            $type = static::getDefaultType();
        }

        if ($channel === null) {
            $channel = static::getDefaultChannel();
        }

        if ($role === null) {
            $role = static::getDefaultRole();
        }

        if ($user === null) {
            $user = static::getDefaultUser();
        }

        if ($createdAt === null) {
            $createdAt = static::getDefaultCreatedAt();
        }

        /* @var $message Message */
        $message = new self($subject, $body, $priority, $type, $channel, $role, $user, $createdAt);

        return $message;
    }
1010367
public function setSubject($subject)
    {
        if ($this->_subject === null) {
            $subject = $this->_filterOther($subject);
            $this->_subject = $this->_encodeHeader($subject);
            $this->_storeHeader('Subject', $this->_subject);
        } else {
            /**
             * @see Zend_Mail_Exception
             */
            // require_once 'Zend/Mail/Exception.php';
            throw new Zend_Mail_Exception('Subject set twice');
        }
        return $this;
    }