1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Contacts: Adjust some class names

This commit is contained in:
Thomas Tanghus 2013-04-25 01:03:05 +02:00
parent 6bc6d8f478
commit 8414c16955
7 changed files with 16 additions and 14 deletions

View File

@ -26,7 +26,7 @@ namespace OCA\Contacts;
* Subclass this for PIM collections
*/
abstract class PIMCollectionAbstract extends PIMObjectAbstract implements \Iterator, \Countable, \ArrayAccess {
abstract class AbstractPIMCollection extends AbstractPIMObject implements \Iterator, \Countable, \ArrayAccess {
// Iterator properties

View File

@ -26,7 +26,7 @@ namespace OCA\Contacts;
* Subclass this class or implement IPIMObject interface for PIM objects
*/
abstract class PIMObjectAbstract implements IPIMObject {
abstract class AbstractPIMObject implements IPIMObject {
/**
* This variable holds the ID of this object.

View File

@ -25,7 +25,7 @@ namespace OCA\Contacts;
/**
* This class manages our addressbooks.
*/
class Addressbook extends PIMCollectionAbstract {
class Addressbook extends AbstractPIMCollection {
protected $_count;
/**
@ -153,7 +153,7 @@ class Addressbook extends PIMCollectionAbstract {
* @return Contact[]
*/
function getChildren($limit = null, $offset = null, $omitdata = false) {
\OCP\Util::writeLog('contacts', __METHOD__.' backend: ' . print_r($this->backend, true), \OCP\Util::DEBUG);
//\OCP\Util::writeLog('contacts', __METHOD__.' backend: ' . print_r($this->backend, true), \OCP\Util::DEBUG);
$contacts = array();
foreach($this->backend->getContacts($this->getId(), $limit, $offset, $omitdata) as $contact) {
@ -163,7 +163,7 @@ class Addressbook extends PIMCollectionAbstract {
}
$contacts[] = $this->objects[$contact['id']];
}
\OCP\Util::writeLog('contacts', __METHOD__.' children: '.count($contacts), \OCP\Util::DEBUG);
//\OCP\Util::writeLog('contacts', __METHOD__.' children: '.count($contacts), \OCP\Util::DEBUG);
return $contacts;
}

View File

@ -44,7 +44,7 @@ class Shared extends Database {
$this->addressbooks = \OCP\Share::getItemsSharedWith(
'addressbook',
Contacts\Share_Backend_Addressbook::FORMAT_ADDRESSBOOKS
Contacts\Share\Addressbook::FORMAT_ADDRESSBOOKS
);
return $this->addressbooks;
@ -61,7 +61,7 @@ class Shared extends Database {
$addressbook = \OCP\Share::getItemSharedWithBySource(
'addressbook',
$addressbookid,
Contacts\Share_Backend_Addressbook::FORMAT_ADDRESSBOOKS
Contacts\Share\Addressbook::FORMAT_ADDRESSBOOKS
);
// Not sure if I'm doing it wrongly, or if its supposed to return
// the info in an array?
@ -83,7 +83,7 @@ class Shared extends Database {
$addressbook = \OCP\Share::getItemSharedWithBySource(
'addressbook',
$addressbookid,
Contacts\Share_Backend_Addressbook::FORMAT_ADDRESSBOOKS,
Contacts\Share\Addressbook::FORMAT_ADDRESSBOOKS,
null, // parameters
true // includeCollection
);

View File

@ -42,7 +42,7 @@ class GroupController extends BaseController {
$groups = array(
'categories' => $categories,
'favorites' => $favorites,
'shared' => \OCP\Share::getItemsSharedWith('addressbook', \OCA\Contacts\Share_Backend_Addressbook::FORMAT_ADDRESSBOOKS),
'shared' => \OCP\Share::getItemsSharedWith('addressbook', \OCA\Contacts\Share\Addressbook::FORMAT_ADDRESSBOOKS),
'lastgroup' => \OCP\Config::getUserValue($params['user'], 'contacts', 'lastgroup', 'all'),
'sortorder' => \OCP\Config::getUserValue($params['user'], 'contacts', 'groupsort', ''),
);

View File

@ -6,9 +6,10 @@
* See the COPYING-README file.
*/
namespace OCA\Contacts;
namespace OCA\Contacts\Share;
use OCA\Contacts\Backend\Database;
class Share_Backend_Addressbook implements \OCP\Share_Backend_Collection {
class Addressbook implements \OCP\Share_Backend_Collection {
const FORMAT_ADDRESSBOOKS = 1;
const FORMAT_COLLECTION = 2;
@ -16,7 +17,7 @@ class Share_Backend_Addressbook implements \OCP\Share_Backend_Collection {
public function __construct() {
// Currently only share
$this->backend = new Backend\Database();
$this->backend = new Database();
}
/**

View File

@ -19,9 +19,10 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
namespace OCA\Contacts;
namespace OCA\Contacts\Share;
use OCA\Contacts;
class Share_Backend_Contact implements \OCP\Share_Backend {
class Contact implements \OCP\Share_Backend {
const FORMAT_CONTACT = 0;