File: BinaryAttribute.php

package info (click to toggle)
phpldapadmin 1.1.0.5-6%2Blenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,008 kB
  • ctags: 3,949
  • sloc: php: 17,735; xml: 1,532; sh: 388; makefile: 46
file content (55 lines) | stat: -rw-r--r-- 1,143 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/BinaryAttribute.php,v 1.2 2007/12/15 07:50:32 wurley Exp $

/**
 * @package phpLDAPadmin
 * @author Xavier Bruyet
 *
 * Represents an attribute whose values are binaries
 */
class BinaryAttribute extends Attribute {
	protected $filepaths;
	protected $filenames;

	public function __construct($name, $values) {
		parent::__construct($name, $values);

		$this->filepaths = array();
		$this->filenames = array();
	}

	public function getFileNames() {
		return $this->filenames;
	}

	public function getFileName($i) {
		if (isset($this->filenames[$i])) return $this->filenames[$i];
		else return null;
	}

	public function addFileName($name, $i = -1) {
		if ($i < 0) {
			$this->filenames[] = $name;
		} else {
			$this->filenames[$i] = $name;
		}
	}

	public function getFilePaths() {
		return $this->filepaths;
	}

	public function getFilePath($i) {
		if (isset($this->filepaths[$i])) return $this->filepaths[$i];
		else return null;
	}

	public function addFilePath($path, $i = -1) {
		if ($i < 0) {
			$this->filepaths[] = $path;
		} else {
			$this->filepaths[$i] = $path;
		}
	}
}
?>