eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway::loadTypeData PHP Méthode

loadTypeData() abstract public méthode

Loads an array with data about $typeId in $status.
abstract public loadTypeData ( mixed $typeId, integer $status ) : array
$typeId mixed
$status integer
Résultat array Data rows.
    public abstract function loadTypeData($typeId, $status);

Usage Example

    /**
     * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException If type is defined and still has content
     * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If type is not found
     *
     * @param mixed $contentTypeId
     * @param int $status
     *
     * @return boolean
     */
    public function delete( $contentTypeId, $status )
    {
        if ( !$this->contentTypeGateway->loadTypeData( $contentTypeId, $status ) )
        {
            throw new NotFoundException(
                "ContentType",
                array(
                    "id" => $contentTypeId,
                    "status" => $status
                )
            );
        }

        if ( Type::STATUS_DEFINED === $status && $this->contentTypeGateway->countInstancesOfType( $contentTypeId ) )
        {
            throw new BadStateException(
                "\$contentTypeId",
                "ContentType with given id still has content instances and therefore can't be deleted"
            );
        }

        $this->contentTypeGateway->delete(
            $contentTypeId, $status
        );

        // @todo FIXME: Return true only if deletion happened
        return true;
    }
All Usage Examples Of eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway::loadTypeData