Class Socialveo\WebApi\Controllers\SearchController

InheritanceSocialveo\WebApi\Controllers\SearchController » Socialveo\WebApi\Controllers\RestApiController » Phalcon\Mvc\Controller
Uses TraitsSocialveo\Core\Translatable

Class SearchController

Public Methods

Hide inherited methods

MethodDescriptionDefined By
_handleException() Handle exceptions Socialveo\WebApi\Controllers\RestApiController
_t() Gets translations Socialveo\Core\Translatable
afterExecuteRoute() After execute route, change return value to json Socialveo\WebApi\Controllers\RestApiController
beforeExecuteRoute() Before execute route, remove extra params Socialveo\WebApi\Controllers\RestApiController
checkClientCredentials() Checks client credentials Socialveo\WebApi\Controllers\RestApiController
completeAction() Complete action, detect type of search by config Socialveo\WebApi\Controllers\SearchController
decrypt() Decrypt value Socialveo\WebApi\Controllers\RestApiController
encrypt() Encrypt value Socialveo\WebApi\Controllers\RestApiController
friendsAction() Search friends (2-way connected) with ability to exclude users by uuids. Socialveo\WebApi\Controllers\SearchController
getArrayFromParam() Returns array from params Socialveo\WebApi\Controllers\RestApiController
getLanguage() Gets language code Socialveo\WebApi\Controllers\RestApiController
getParams() Gets request params for Socialveo::filteredFind() Socialveo\WebApi\Controllers\RestApiController
getRequestData() Returns request data Socialveo\WebApi\Controllers\RestApiController
getRequiredParam() Get required param Socialveo\WebApi\Controllers\RestApiController
getToken() Get token Socialveo\WebApi\Controllers\RestApiController
getTranslation() Gets translations Socialveo\WebApi\Controllers\RestApiController
handleError() Handle errors Socialveo\WebApi\Controllers\RestApiController
handleException() Handle exceptions Socialveo\WebApi\Controllers\RestApiController
hashtagsAction() Search hashtags Socialveo\WebApi\Controllers\SearchController
indexAction() Search by query string. Socialveo\WebApi\Controllers\SearchController
initialize() Initialize controller Socialveo\WebApi\Controllers\RestApiController
invalidMethodAction() Action trigger when invalid action tried run Socialveo\WebApi\Controllers\RestApiController
mentionsAction() Search mentions Socialveo\WebApi\Controllers\SearchController
networksAction() Search networks Socialveo\WebApi\Controllers\SearchController
notFoundAction() Not found action Socialveo\WebApi\Controllers\RestApiController
posts() Gets posts Socialveo\WebApi\Controllers\RestApiController
replaceParam() Replace param Socialveo\WebApi\Controllers\RestApiController
respondWithItem() Response with item // * @deprecated Socialveo\WebApi\Controllers\RestApiController
sendJsonContent() Send response as json content and exit Socialveo\WebApi\Controllers\RestApiController
sendJsonContentRaw() Send json content Socialveo\WebApi\Controllers\RestApiController
sendJsonContentRawStatic() Send json content static Socialveo\WebApi\Controllers\RestApiController
setDefaultParam() Set default option Socialveo\WebApi\Controllers\RestApiController
t() Gets translations Socialveo\Core\Translatable
typesAction() Search query string by types (sort each type in columns). Socialveo\WebApi\Controllers\SearchController
unsetParam() Unset get param Socialveo\WebApi\Controllers\RestApiController
usersAction() Search users with ability to exclude users by uuids. Socialveo\WebApi\Controllers\SearchController

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkAccess() Checks during the init of controller whether user is a guest. Socialveo\WebApi\Controllers\RestApiController
getExcludeIds() Get excluded uuids Socialveo\WebApi\Controllers\SearchController
log() Log full request data for debug Socialveo\WebApi\Controllers\RestApiController
objectsToArray() Convert objects to arrays Socialveo\WebApi\Controllers\RestApiController

Method Details

completeAction() public method

Complete action, detect type of search by config

public void completeAction ( )
friendsAction() public method

Search friends (2-way connected) with ability to exclude users by uuids.

/search/friends

Method: GET

Access: Logged

Parameters:

query required string query string
exclude_user_uuids[] optional string or array coma separated User uuids or array to exclude from result
page or offset optional integer page start or offset
limit optional integer page limit
order optional string order by property value, order either desc or asc
language optional string language code

Note. exclude_user_uuids[] - excludes passed users from result

Returns: User []

Sample response:

{
    "status": "OK",
    "data":[
        {"type": "user", "uuid": "4306270a-27fd-11e6-9bba-54bef75c7a3f", "network_uuid": "4364a38e-27fd-11e6-a56a-54bef75c7a3f",…},
        {"type": "user", "uuid": "951988be-27ff-11e6-9c32-54bef75c7a3f", "network_uuid": "95619d98-27ff-11e6-92a3-54bef75c7a3f",…},
        {"type": "user", "uuid": "b59f11e2-2801-11e6-a325-54bef75c7a3f", "network_uuid": "b5c9303a-2801-11e6-ba4c-54bef75c7a3f",…},
        {"type": "user", "uuid": "9644a4a2-2846-11e6-bbe9-54bef75c7a3f", "network_uuid": "96634dbc-2846-11e6-b502-54bef75c7a3f",…}
        ...
    ],
    "count":{"offset": 0, "limit": 4, "total": null},
    "timestamp": 1234567890
}

public mixed friendsAction ( )
throws Exception
getExcludeIds() protected method

Get excluded uuids

protected array getExcludeIds ( $exclude_object_uuids, $object_uuids )
$exclude_object_uuids string
$object_uuids string
throws Exception
hashtagsAction() public method

Search hashtags

public Phalcon\Http\Response hashtagsAction ( )
throws Exception
indexAction() public method

Search by query string.

/search

Method: GET

Access: Public

Parameters:

query required string query string
page or offset optional integer page start or offset
limit optional integer page limit
order optional string order by property value, order either desc or asc
language optional string language code

Returns: User []|Network []|Post []|Comment []|Media []|Messages []

Note. When query starts with "#" will be search hashtags in Tag instead of Index

Sample response:

{
    "status": "OK",
    "data":[
        {"type": "user", "uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f", "network_uuid": "a66b8654-14a8-11e6-af87-54bef75c7a3f",…},
        {"type": "post", "uuid": "848174da-194a-11e6-8315-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        {"type": "post", "uuid": "4699aee8-1f27-11e6-aff5-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        {"type": "post", "uuid": "f3cb347a-1f6c-11e6-9107-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        ...
    ],
    "count":{"offset": 0, "limit": 10, "total": null},
    "timestamp": 1234567890
}

public mixed indexAction ( )
throws Exception
mentionsAction() public method

Search mentions

public Phalcon\Http\Response mentionsAction ( )
throws Exception
networksAction() public method

Search networks

public Phalcon\Http\Response networksAction ( )
throws Exception
typesAction() public method

Search query string by types (sort each type in columns).

/search/types

Method: GET

Access: Public

Parameters:

query required string query string
page or offset optional integer page start or offset
limit optional integer page limit
order optional string order by property value, order either desc or asc
language optional string language code

Returns: [User []|Network []|Post []|Comment []|Media []|Messages []]

Sample response:

{
    "status": "OK",
    "data":{
        "user":[
            {"type": "user", "uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f", "network_uuid": "a66b8654-14a8-11e6-af87-54bef75c7a3f",…},
            {"type": "user", "uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f", "network_uuid": "a66b8654-14a8-11e6-af87-54bef75c7a3f",…},
        ],
        "network":[
            {"type": "network", "uuid": "91795ea4-29cc-11e6-a91d-54bef75c7a3f", "payment_id": 0, "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…}
            {"type": "network", "uuid": "91795ea4-29cc-11e6-a91d-54bef75c7a3f", "payment_id": 0, "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…}
        ],
        "post":[
            {"type": "post", "uuid": "848174da-194a-11e6-8315-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
            {"type": "post", "uuid": "848174da-194a-11e6-8315-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        ]
    },
    "count":{ "offset": 0, "limit": 10, "total": null },
    "timestamp": 1234567890
}

public mixed typesAction ( )
throws Exception
usersAction() public method

Search users with ability to exclude users by uuids.

/search/users

Method: GET

Access: Public

Parameters:

query required string query string
exclude_user_uuids[] optional string or array coma separated User uuids or array to exclude from result
page or offset optional integer page start or offset
limit optional integer page limit
order optional string order by property value, order either desc or asc
language optional string language code

Note. exclude_user_uuids[] - excludes passed users from result

Returns: User []

Sample response:

{
    "status": "OK",
    "data":[
        {"type": "user", "uuid": "4306270a-27fd-11e6-9bba-54bef75c7a3f", "network_uuid": "4364a38e-27fd-11e6-a56a-54bef75c7a3f",…},
        {"type": "user", "uuid": "951988be-27ff-11e6-9c32-54bef75c7a3f", "network_uuid": "95619d98-27ff-11e6-92a3-54bef75c7a3f",…},
        {"type": "user", "uuid": "b59f11e2-2801-11e6-a325-54bef75c7a3f", "network_uuid": "b5c9303a-2801-11e6-ba4c-54bef75c7a3f",…},
        {"type": "user", "uuid": "9644a4a2-2846-11e6-bbe9-54bef75c7a3f", "network_uuid": "96634dbc-2846-11e6-b502-54bef75c7a3f",…}
        ...
    ],
    "count":{"offset": 0, "limit": 4, "total": null},
    "timestamp": 1234567890
}

public mixed usersAction ( )
throws Exception